Skip to content

Commit 8584bb8

Browse files
committed
Split research plugin from experimental compiler version
1 parent 2c2e8af commit 8584bb8

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
@@ -163,7 +163,7 @@ object Feature:
163163
do checkExperimentalFeature(s"feature $setting", NoSourcePosition)
164164

165165
def isExperimentalEnabled(using Context): Boolean =
166-
(Properties.experimental && !ctx.settings.YnoExperimental.value) || ctx.settings.experimental.value
166+
(Properties.unstableExperimentalEnabled && !ctx.settings.YnoExperimental.value) || ctx.settings.experimental.value
167167

168168
/** Handle language import `import language.<prefix>.<imported>` if it is one
169169
* 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)