Adds some tests to ensure types like | or & (in addition to ! from the ticket) correctly work in return type check.
Fixes a weird behaviour where we used to avoid processing type related IR transformations inside of type ascriptions.
Adds parentheses to type representations if they are more complex: A | B & C is unclear as it can either mean A | (B & C) or (A | B) & C which have different meanings. If we now have an operation with such nesting, the sub expressions are wrapped in parentheses to disambiguate.
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
[x] The documentation has been updated, if necessary.
[ ] Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
[x] All code follows the
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
Pull Request Description
|
or&
(in addition to!
from the ticket) correctly work in return type check.A | B & C
is unclear as it can either meanA | (B & C)
or(A | B) & C
which have different meanings. If we now have an operation with such nesting, the sub expressions are wrapped in parentheses to disambiguate.Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR: