Skip to content

Commit a46bd85

Browse files
Correctly check experimental features
- When inlining: emit "experimental" error only when the feature in question is actually annotated as experimental - Compiler-wide: treat non-bootstrapped compiler as experimental-friendly. The motivation is to compile the standard library with experimental features enabled at all times. This change isn't supposed to introduce any experimental features leaks into stable builds since we do not publish non-bootstrapped compiler.
1 parent fa36577 commit a46bd85

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

compiler/src/dotty/tools/dotc/config/Properties.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ trait PropertiesTrait {
8484

8585
/** Whether the current version of compiler is experimental
8686
*
87-
* 1. Snapshot and nightly releases are experimental.
87+
* 1. Snapshot, nightly releases and non-bootstrapped compiler are experimental.
8888
* 2. Features supported by experimental versions of the compiler:
8989
* - research plugins
9090
*/
91-
val experimental: Boolean = versionString.contains("SNAPSHOT") || versionString.contains("NIGHTLY")
91+
val experimental: Boolean = versionString.contains("SNAPSHOT") || versionString.contains("NIGHTLY") || versionString.contains("nonbootstrapped")
9292

9393
val copyrightString: String = scalaPropOrElse("copyright.string", "(c) 2002-2017 LAMP/EPFL")
9494

compiler/src/dotty/tools/dotc/typer/Inliner.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ object Inliner {
9494
if (tree.symbol == defn.CompiletimeTesting_typeChecks) return Intrinsics.typeChecks(tree)
9595
if (tree.symbol == defn.CompiletimeTesting_typeCheckErrors) return Intrinsics.typeCheckErrors(tree)
9696

97-
Feature.checkExperimentalDef(tree.symbol, tree)
97+
if tree.symbol.isExperimental then
98+
Feature.checkExperimentalDef(tree.symbol, tree)
9899

99100
/** Set the position of all trees logically contained in the expansion of
100101
* inlined call `call` to the position of `call`. This transform is necessary

0 commit comments

Comments
 (0)