-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle ternary intersection types (#9799)
Starting in GWT 2.9.0 (check jdt vers), JDT changed how it emitted ternary expressions to result in intersection casts in at least two cases: * When concatenating the result of the ternary to a string * When assigning a local field typed with `var`. This error only previously happened when assertions were enabled - the existing code seems to behave more or less as expected. This fix allows for those two cases to use intersection types, but since the GWT AST doesn't have support for intersection types, the fix selects the first non-java.lang.Object type in the list of types. This is consistent with what we used to do here, but by changing these specific cases rather than altering JdtUtil.signature() we only permit intersection types in these specific cases. It is technically possible for a JDT WildcardBinding to show up as an intersection cast, but because JdtUtil.signature() already calls erasure() on the TypeBinding, we will never fail the assertion in this way. JUnitShell now will log context of where a compilation error occurred, and the specific assertion that previously failed will also log the encountered type, to aid future debugging in this area. Fixes #9694
- Loading branch information
Showing
6 changed files
with
72 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters