-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhanced switch v2.0 - Part I #3310
Enhanced switch v2.0 - Part I #3310
Conversation
e6e7150
to
788c361
Compare
7bed7f4
to
c2ce23c
Compare
2a359de
to
4014d90
Compare
4014d90
to
9a423c4
Compare
9a423c4
to
19d4fc9
Compare
This pull request changes some projects for the first time in this development cycle.
An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patch
Further information are available in Common Build Issues - Missing version increments. |
2863b97
to
2363e0f
Compare
a7022ad
to
32b09fd
Compare
@HannesWell , I hear from @iloveeclipse that this automatic increment of versions in the new development cycle is your contribution. It used to irritate me to have to do that manually - thank you so much for this feature 👍 👏 |
Do we expect comparator issues coming from this one? If yes, I would rather start an I-build now so they can be looked at today. |
I doubt it - there are some class file and code generation changes for sure particularly in the context of #3321 but that likely affects only Java 21 sources. That we didn't see any comparator issues in jdt's own CI build is a sign. All that said, this is a massive, near complete rewrite of various portions of switch/case handling. Thanks very much @akurtakov |
04:38:30 [ERROR] Cannot resolve dependencies of project org.eclipse.platform.feature:org.eclipse.platform:eclipse-feature:4.35.0-SNAPSHOT Not sure if this is the root problem If a rebuild is triggered, we may as well include the commit srikanth-sankaran@1cf69bb that just got merged - |
I meant this commit: 1cf69bb |
@akurtakov - I am not familiar with the build set up so unable to analyze the next steps ... |
https://ci.eclipse.org/releng/job/Builds/job/I-build-4.35/6/consoleFull went beyond the previous failures. For the record - I-builds always use master of all submodules so this commit should be included in this build. |
You are very welcome and thanks for the nice words. I'm glad it it's helpful. :) |
Thanks to you too @laeubi 👍 |
Reimplement resolution, analysis and bookkeeping involved with
CaseStatement
and resolution ofSwitchStatement
for a streamlined and cleaner implementation resulting in readily obvious control flow and minimization of state.Report non-constant label expressions during resolution rather than waiting for flow analysis phase.
Change how duplicate label expressions are reported. Don't blame the whole case, just the duplicate expression; Don't blame the original, just the duplicate.
Represent qualified enumerators with qualified names internally so to avoid name clashes
Eliminate the hack to inject synthetic
BreakStatement
in label rule switch blocks. Enhance the code generator to handle these explicitly.Simplify the implementation of SwitchStatement.getFallThroughState correcting various issues.
Eliminate the unnecessary vector
SwitchStatement.constMapping
that is passed toorg.eclipse.jdt.internal.compiler.codegen.CodeStream.tableswitch
- constanMapping[i] == i always!Enable various tests in
PrimitiveInPatternsTest.java
that were disabled, fixing broken tests; Remove their disabled cousins fromPrimitiveInPatternsTestSH.java
Add a disabled regression test for [Enhanced Switch][Null] Inconsistent nullness propagation #3319 (not yet understood/fixed)
Numerous defect fixes as listed below
Fixes [Enhanced Switch][Primitive Patterns] Bogus error:
Case constants in a switch on 'Long' must have type 'long'
#3336Fixes [Enhanced Switch] ECJ tolerates fall through to default from a case with pattern label while javac rejects it. #3318
Fixes [Enhanced Switch][Patterns] ECJ generated code hangs #3320
Fixes [Enhanced Switch] ECJ uses 3 secret variables where just one (or even zero in most cases) would do #3321
Fixes [Enhanced Switch] Bogus duplicate case error from ECJ #3334
Fixes [Enhanced Switch][Record Patterns] ECJ compiles non-exhaustive switch resulting in MatchException being thrown at runtime #3335
Fixes [Primitive Patterns] Wrong duplicate case error #3265
Fixes [21][Enhanced Switch] Bogus error: "Cannot mix pattern with other case labels" #3169
Fixes [Enhanced Switch][Regression] Incorrect duplicate case error since https://github.com/eclipse-jdt/eclipse.jdt.core/pull/3264 #3339
Fixes [Enhanced Switch][Primitive Patterns] ECJ tolerates default case in boolean switch with both true and false cases. #3337
Fixes [Enhanced Switch] Problem with switch and enums - incorrect duplicate case error #3344