Call for feedback -- enhanced switch
Brian Goetz
brian.goetz at oracle.com
Sat Mar 23 17:40:59 UTC 2019
> BTW, it remember me something i have forgotten to ask, for both ecj and javac, when you compile with --enable-preview, all the classes have they minor version changed even the one that doesn't use the switch expression. I've tried to find where this behaviour was documented in the JEP 12 [2] but the "compile-time" section is not clear about that.
That's correct. This is not unlike compiling with -source/-target N;
even if it doesn't use any features added in N, it writes out that
version of the classfile. This is predictable for users and way simpler
for compilers. The alternative is getting into an interpretation of
"could this classfile run on a different version", whose
complexity/benefit ratio would be way out of balance.
More information about the amber-dev
mailing list