-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Tests need to allow experimental imports #11915
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
Comments
This is not needed, just put the test in one of the folders is enough:
We cannot just use import for an experimental feature in the tests, as the tests will also be compiled by a RELEASE compiler, which does not support experimental features. |
Yes, and I think that's completely unacceptable, as I explained in the issue. |
I see two alternatives:
|
I think that's what we have to do. Or use a private settable variable that is set only in the test runners. |
In any case we have to get rid of those experimental subdirectories. That's the most urgent thing to do. That was a lot of change for getting a much deteriorated workflow. |
…d nightly This reverts PR scala#11852. See scala#11915.
It is now reverted: #11916. |
…d nightly This reverts PR scala#11852. See scala#11915.
Thanks for the quick reaction @liufengyun! We should still disable experimental imports in stable releases but with less drastic changes |
The goal described above is to treat an experimental test as a normal test (to easily put it anywhere). It implies the stable release compiler has to support experimental features (via a compiler flag or other hacks). And we still need another flag to disable experimental features in NIGHTLY compiler for neg tests of experimental language imports. So each way is a trade-off: either we follow the convention to put experimental tests in appropriate folders, or we compromise the guarantee that users cannot use experimental features in stable releases. |
The enabling flag could be a private variable that is set to true only from within our internal testing framework. That means we allow experimental in our internal tests but not in other code compiled by a release compiler. |
The situation so far was that we have a menagerie of Y flags that enabled non-standard feature and and associated menagerie of meandering test scripts that enabled these flags for specific tests.
Language imports promised to change all that. Instead of having a test in some magic location or with some magic invocation, we specify the assumptions of the test in the test sourcecode itself. This works great, and would be an ideal mechanism to try out future language features in tests.
Unfortunately we shot ourselves in the foot with #11852. Now, experimental imports are disabled for normal tests. What you have to do is
I find that bureaucracy unbearable. It will lead to everyone reverting to special flags for experimental features which conveniently avoid the language import overhead. And that in turn will lead to experimental features that are completely unchecked, since only language imports are checked but not flags.
So, in summary #11852 achieves exactly the opposite of what it was supposed to achieve: It makes dealing with experimental features so burdensome,that everybody will take evasive action.
I think we need to solve this before we go into RC2.
The text was updated successfully, but these errors were encountered: