Skip to content

Commit 5bc2cb1

Browse files
committed
Add hook to simulate a release compiler
and some other cleanups
1 parent 9c2882f commit 5bc2cb1

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,15 @@ object Config {
216216
*/
217217
inline val reuseSymDenotations = true
218218

219-
/** Are experimental imports are allowed? By default same as
219+
/** Turn on in order to test the CI assuming we have a stable release compiler
220+
* instead of a nightly or snapshot.
221+
*/
222+
private val assumeNonExperimentalCompiler = false
223+
224+
/** Are experimental features are allowed? By default same as
220225
* `Properties.experimental`. Can be re-assigned, e.g. to allow tests
221226
* of experimental features.
222227
*/
223-
@sharable private[dotty] var allowExperimentalFeatures = Properties.experimental
228+
@sharable private[dotty] var allowExperimentalFeatures =
229+
Properties.experimental && !assumeNonExperimentalCompiler
224230
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ object Feature:
106106

107107
/** Check that experimental compiler options are only set for snapshot or nightly compiler versions. */
108108
def checkExperimentalSettings(using Context): Unit =
109-
ctx.settings.language.value
110-
.filter(str => str.startsWith("experimental.") && str != "experimental.scala2macros")
111-
.foreach(str => checkExperimentalFeature(s" $str"))
109+
for setting <- ctx.settings.language.value
110+
if setting.startsWith("experimental.") && setting != "experimental.scala2macros"
111+
do checkExperimentalFeature(s" $setting")
112112

113113
end Feature

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import config.Feature
3232
import config.Feature.{sourceVersion, migrateTo3}
3333
import config.SourceVersion._
3434
import config.SourceVersion
35-
import config.Properties
3635

3736
object Parsers {
3837

0 commit comments

Comments
 (0)