Skip to content

Commit 02cc983

Browse files
Split research plugin from experimental compiler version (#19841)
2 parents bcbe6b2 + 8584bb8 commit 02cc983

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ object Feature:
162162
do checkExperimentalFeature(s"feature $setting", NoSourcePosition)
163163

164164
def isExperimentalEnabled(using Context): Boolean =
165-
(Properties.experimental && !ctx.settings.YnoExperimental.value) || ctx.settings.experimental.value
165+
(Properties.unstableExperimentalEnabled && !ctx.settings.YnoExperimental.value) || ctx.settings.experimental.value
166166

167167
/** Handle language import `import language.<prefix>.<imported>` if it is one
168168
* of the global imports `pureFunctions` or `captureChecking`. In this case

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ trait PropertiesTrait {
8686

8787
/** Whether the current version of compiler is experimental
8888
*
89-
* 1. Snapshot, nightly releases and non-bootstrapped compiler are experimental.
90-
* 2. Features supported by experimental versions of the compiler:
91-
* - research plugins
89+
* Snapshot, nightly releases and non-bootstrapped compiler are experimental.
9290
*/
93-
val experimental: Boolean = versionString.contains("SNAPSHOT") || versionString.contains("NIGHTLY") || versionString.contains("nonbootstrapped")
91+
val unstableExperimentalEnabled: Boolean = versionString.contains("SNAPSHOT") || versionString.contains("NIGHTLY") || versionString.contains("nonbootstrapped")
92+
93+
/** Whether the current version of compiler supports research plugins. */
94+
val researchPluginEnabled: Boolean = versionString.contains("SNAPSHOT") || versionString.contains("NIGHTLY") || versionString.contains("nonbootstrapped")
9495

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

compiler/src/dotty/tools/dotc/plugins/Plugins.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ trait Plugins {
129129
val updatedPlan = Plugins.schedule(plan, pluginPhases)
130130

131131
// add research plugins
132-
if Properties.experimental && !ctx.settings.YnoExperimental.value then
132+
if Properties.researchPluginEnabled then
133133
plugins.collect { case p: ResearchPlugin => p }.foldRight(updatedPlan) {
134134
(plug, plan) => plug.init(options(plug), plan)
135135
}

0 commit comments

Comments
 (0)