-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Only enable experimental features for snapshot and nightly (V2) #11920
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
Merged
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
d9d4c1c
Fix #11774: only enable experimental features for snapshot and nightly
odersky b438c16
Exclude scala2macros from experimental checking
odersky 8c353b1
Test with -Yno-experimental
odersky 28b5154
Remove experimental flag in stdlib
liufengyun 9735aa3
Add more tests
odersky a5958f0
Fix compiler version (unknown) in community build
liufengyun a0e47f7
Only test scodec with experimental compiler
odersky 32c88bc
Allow experimental features in Tests
odersky 9c2882f
Address review
liufengyun 5bc2cb1
Add hook to simulate a release compiler
odersky bfb61e3
Fix macros exclude for command line settings
odersky e5bcb1a
Rename allowExperimentalFeatures --> compilerSupportsExperimental
odersky b961fed
Adapt CB to no experiments
odersky 556a0d7
Avoid compilerSupportsExperimental variable in Config
odersky d958847
Update scalap to not use experimental._
odersky 5d6c42c
Try with nonexperimental compiler
odersky a9b808b
Revert "Try with nonexperimental compiler"
odersky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule scalap
updated
6 files
Submodule stdLib213
updated
8 files
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
package dotty.tools.dotc.config | ||
import annotation.internal.sharable | ||
|
||
object Config { | ||
|
||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
class Test0 { | ||
import language.experimental.namedTypeArguments // error | ||
object Foo { | ||
inline def f[S, T](x: S): T = ??? | ||
def g(x: Int) = f[T = Any](x) | ||
} | ||
} | ||
|
||
class Test1 { | ||
import scala.language.experimental.erasedDefinitions // error | ||
import scala.compiletime.erasedValue | ||
type UnivEq[A] | ||
object UnivEq: | ||
erased def force[A]: UnivEq[A] = erasedValue | ||
extension [A](erased proof: UnivEq[A]) | ||
inline def univEq(a: A, b: A): Boolean = | ||
a == b | ||
} | ||
|
||
class Test2 { | ||
import _root_.scala.language.experimental.{genericNumberLiterals, namedTypeArguments => _} // error | ||
val x: BigInt = 13232202002020202020202 | ||
val y: BigInt = -0xaabb12345ACF12345AC | ||
} | ||
|
||
class Test6 { | ||
import scala.language.experimental // ok | ||
} | ||
|
||
class Test7 { | ||
import scala.language.experimental | ||
import experimental.genericNumberLiterals // error: no aliases can be used to refer to a language import | ||
val x: BigInt = 13232202002020202020202 // error | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that we can run the tests from a release compiler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we want to run tests on experimental features on a release compiler? These cannot be used and there will be a nightly that will cover those tests on that day anyway.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests are there so that we can make sure that the compiler code base can in fact handle the experimental features. There's only one codebase. Those tests can be run from either release or experimental versions. The fact that compilers flag experimental imports as errors unless their version string is a nightly or snapshot is orthogonal to this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the previous workaround of
experimental
subdirectores has been reverted.