Skip to content

Commit 556a0d7

Browse files
committed
Avoid compilerSupportsExperimental variable in Config
Instead, use a special exclude if vulpix.ParallelTesting is in the stack trace.
1 parent b961fed commit 556a0d7

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -215,16 +215,4 @@ object Config {
215215
* reduces the number of allocated denotations by ~50%.
216216
*/
217217
inline val reuseSymDenotations = true
218-
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
225-
* `Properties.experimental`. Can be re-assigned, e.g. to allow tests
226-
* of experimental features.
227-
*/
228-
@sharable private[dotty] var compilerSupportsExperimental =
229-
Properties.experimental && !assumeNonExperimentalCompiler
230218
}

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,16 @@ object Feature:
9797
else
9898
false
9999

100-
def compilerSupportsExperimental(using Context) =
101-
Config.compilerSupportsExperimental && !ctx.settings.YnoExperimental.value
100+
private val assumeExperimentalIn = Set("dotty.tools.vulpix.ParallelTesting")
102101

103102
def checkExperimentalFeature(which: String, srcPos: SrcPos = NoSourcePosition)(using Context) =
104-
if !compilerSupportsExperimental then
103+
def hasSpecialPermission =
104+
new Exception().getStackTrace.exists(elem =>
105+
assumeExperimentalIn.exists(elem.getClassName().startsWith(_)))
106+
if !(Properties.experimental || hasSpecialPermission)
107+
|| ctx.settings.YnoExperimental.value
108+
then
109+
//println(i"${new Exception().getStackTrace.map(_.getClassName).toList}%\n%")
105110
report.error(i"Experimental feature$which may only be used with nightly or snapshot version of compiler", srcPos)
106111

107112
/** Check that experimental compiler options are only set for snapshot or nightly compiler versions. */

compiler/test/dotty/tools/vulpix/ParallelTesting.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ import dotty.tools.vulpix.TestConfiguration.defaultOptions
3939
trait ParallelTesting extends RunnerOrchestration { self =>
4040
import ParallelTesting._
4141

42-
Config.compilerSupportsExperimental = true
43-
4442
/** If the running environment supports an interactive terminal, each `Test`
4543
* will be run with a progress bar and real time feedback
4644
*/

0 commit comments

Comments
 (0)