-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Consider minTargetVersion as always supported #13811
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
Conversation
CLA signed |
I'm wondering whether this simple solution might break something. Basically when |
Same here. Such a simple change looked very suspicious to me either, but I don't know the codebase, where to check for the JDK specific processing.
Or apply it the way Main point of the original issue and this PR specifically is to make it looking consistent for the client and left the JDK internals magic to the compiler, not exposing it to every build. |
You could try writing some test, which compiles and runs some code with |
Will take a look on how to write a test later this week. @prolativ could you suggest a good one I can use as a starting point to understand how tests are expected to look? |
Here's a general description of how tests in scala 3 repo work https://dotty.epfl.ch/docs/contributing/testing.html In your particular case you should have a look at other tests in |
Added test, which checks the consistent error compiling JDK 9 application with Can't imagine if it is possible to compose a test, which will compile JDK 9 API enabled code running on JDK 8 (should be possible on unaltered JDK only if it is possible to specify explicit JDK classpath while running compiler on JDK 8, but if someone will do so, they should account for possible classpath related errors on their own and should not use |
I did some analysis and it looks like the cases I was afraid would fail with Additionally I think we should also have some positive test to check that |
I don't think it matters much either way really, though I think it'd be fine to make -release X do nothing at all on JDK X. |
@smarter There's one more thing that I realized now - if one does not specify |
It's a dangerous thing to rely on since if they have mixed java/scala code, the javac compiler will emit JDK X bytecode by default, so I think we should change that behavior at some point, but only in a minor release. |
Ok, if we decide to change that, scala 3.2 seems to be the most appropriate point as we'll be adding |
Added pos test with basic app using JDK 8 level APIs. |
@arixmkii The CI doesn't run for your PR. I guess it's because you need to resolve the conflict with the master branch first. |
@prolativ will fix them. What is the preferred way in this project - rebasing or merge from master to the feature branch? |
Personally I prefer rebasing (with squashing) because it gives you nicer history but honestly speaking this doesn't seem to be enforced anyhow in the repo |
Rebased to latest master. |
The CI failed but this seems to be a problem on master, not this branch |
Saw the same failure locally after rebasing - both with JDK 8 and JDK 11. Did clean checkout of dotty and it was ok (single test run). Running |
Yeah, we'll need to wait until #13878 (comment) gets solved to merge this |
@arixmkii try to rebase to the newest master and resolve any conflicts. I hope this should work now |
Rebased to latest master. |
Fixes #13810
[test_java8]
Allows to use consistent scalac options running with JDK 1.8 and higher if targeting Java8 bytecode level.
Don't know if there are more places to check for more code changes required.