Skip to content

Commit eb477fd

Browse files
committed
Disable experimental by default in unstable builds
1 parent 64f92c5 commit eb477fd

File tree

43 files changed

+82
-48
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+82
-48
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ object Feature:
142142
em"""Experimental $which may only be used under experimental mode:
143143
| 1. in a definition marked as @experimental, or
144144
| 2. an experimental feature is imported in at the package level, or
145-
| 3. compiling with the -experimental compiler flag, or
146-
| 4. with a nightly or snapshot version of the compiler.$note
145+
| 3. compiling with the -experimental compiler flag.$note
147146
|""", srcPos)
148147

149148
private def ccException(sym: Symbol)(using Context): Boolean =
@@ -162,7 +161,6 @@ object Feature:
162161
checkExperimentalFeature("definition", srcPos, s"\n\n$note")
163162

164163
def isExperimentalEnabledBySetting(using Context): Boolean =
165-
(Properties.unstableExperimentalEnabled && !ctx.settings.YnoExperimental.value) ||
166164
ctx.settings.experimental.value ||
167165
experimentalAutoEnableFeatures.exists(enabledBySetting)
168166

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,6 @@ trait PropertiesTrait {
8484
*/
8585
val versionString: String = "version " + simpleVersionString
8686

87-
/** Whether the current version of compiler is experimental
88-
*
89-
* Snapshot, nightly releases and non-bootstrapped compiler are experimental.
90-
*/
91-
val unstableExperimentalEnabled: Boolean = versionString.contains("SNAPSHOT") || versionString.contains("NIGHTLY") || versionString.contains("nonbootstrapped")
92-
9387
/** Whether the current version of compiler supports research plugins. */
9488
val researchPluginEnabled: Boolean = versionString.contains("SNAPSHOT") || versionString.contains("NIGHTLY") || versionString.contains("nonbootstrapped")
9589

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ private sealed trait YSettings:
399399
val YretainTrees: Setting[Boolean] = BooleanSetting("-Yretain-trees", "Retain trees for top-level classes, accessible from ClassSymbol#tree")
400400
val YshowTreeIds: Setting[Boolean] = BooleanSetting("-Yshow-tree-ids", "Uniquely tag all tree nodes in debugging output.")
401401
val YfromTastyIgnoreList: Setting[List[String]] = MultiStringSetting("-Yfrom-tasty-ignore-list", "file", "List of `tasty` files in jar files that will not be loaded when using -from-tasty.")
402-
val YnoExperimental: Setting[Boolean] = BooleanSetting("-Yno-experimental", "Disable experimental language features by default in NIGHTLY/SNAPSHOT versions of the compiler.")
402+
val YnoExperimental: Setting[Boolean] = BooleanSetting("-Yno-experimental", "Disable experimental language features by default in NIGHTLY/SNAPSHOT versions of the compiler (deprecated, no-op).")
403403
val YlegacyLazyVals: Setting[Boolean] = BooleanSetting("-Ylegacy-lazy-vals", "Use legacy (pre 3.3.0) implementation of lazy vals.")
404404
val YcompileScala2Library: Setting[Boolean] = BooleanSetting("-Ycompile-scala2-library", "Used when compiling the Scala 2 standard library.")
405405
val YoutputOnlyTasty: Setting[Boolean] = BooleanSetting("-Youtput-only-tasty", "Used to only generate the TASTy file without the classfiles")

compiler/test/dotty/tools/backend/jvm/PublicInBinaryTests.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class PublicInBinaryTests extends DottyBytecodeTest {
4242
override def initCtx =
4343
val ctx0 = super.initCtx
4444
ctx0.setSetting(ctx0.settings.experimental, true)
45-
ctx0.setSetting(ctx0.settings.YnoExperimental, true)
4645

4746
@Test
4847
def publicInBinaryDef(): Unit = {

docs/_docs/reference/other-new-features/experimental-defs.md

Lines changed: 1 addition & 4 deletions

docs/_spec/TODOreference/other-new-features/experimental-defs.md

Lines changed: 1 addition & 4 deletions

project/Build.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,6 +1759,9 @@ object Build {
17591759
SourceLinksIntegrationTest / scalaSource := baseDirectory.value / "test-source-links",
17601760
SourceLinksIntegrationTest / test:= ((SourceLinksIntegrationTest / test) dependsOn generateScalaDocumentation.toTask("")).value,
17611761
).
1762+
settings(
1763+
scalacOptions += "-experimental" // workaround use of experimental .info in Scaladoc2AnchorCreator
1764+
).
17621765
settings(
17631766
Compile / resourceGenerators ++= Seq(
17641767
generateStaticAssetsTask.taskValue,

scala2-library-cc/src/scala/collection/generic/IsSeq.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ object IsSeq {
5858
* The helper method [[seqViewIsSeq_]] is added to make the binary compatible.
5959
*/
6060
@annotation.targetName("seqViewIsSeq")
61-
@annotation.publicInBinary
62-
private[IsSeq] def seqViewIsSeq_[CC0[X] <: SeqView[X], A0]: IsSeq[CC0[A0]] { type A = A0; type C = View[A0] } = ???
61+
// @annotation.publicInBinary private[IsSeq] // FIXME: enable when publicInBinary becomes stable
62+
def seqViewIsSeq_[CC0[X] <: SeqView[X], A0]: IsSeq[CC0[A0]] { type A = A0; type C = View[A0] } = ???
6363
implicit inline def seqViewIsSeq[CC0[X] <: SeqView[X], A0]: IsIterable[CC0[A0]] { type A = A0; type C = View[A0] } = seqViewIsSeq_[CC0, A0].asInstanceOf
6464

6565
/** !!! Under cc, views are not Seqs and can't use SeqOps.
6666
* Therefore, [[stringViewIsSeq]] now returns an [[IsIterable]].
6767
* The helper method [[stringViewIsSeq__]] is added to make the binary compatible.
6868
*/
6969
@annotation.targetName("stringViewIsSeq")
70-
@annotation.publicInBinary
71-
private[IsSeq] val stringViewIsSeq_ : IsSeq[StringView] { type A = Char; type C = View[Char] } = ???
70+
// @annotation.publicInBinary private[IsSeq] // FIXME: enable when publicInBinary becomes stable
71+
val stringViewIsSeq_ : IsSeq[StringView] { type A = Char; type C = View[Char] } = ???
7272
inline implicit def stringViewIsSeq: IsIterable[StringView] { type A = Char; type C = View[Char] } = stringViewIsSeq_.asInstanceOf
7373

7474
implicit val stringIsSeq: IsSeq[String] { type A = Char; type C = String } =

scaladoc-testcases/src/tests/hugetype.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ trait E:
3030
@deprecated
3131
protected implicit def same[A](a: A): A
3232

33-
trait XD extends E:
33+
@experimental trait XD extends E:
3434
/**
3535
* Some important information :o
3636
*

scaladoc-testcases/src/tests/methodsAndConstructors.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package tests.methodsAndConstructors
22

3+
import scala.language.experimental.clauseInterleaving
4+
35
class A
46
class B extends A
57
class C
@@ -60,8 +62,6 @@ class Methods:
6062
def withImplicitParam2(v: String)(implicit ab: Double, a: Int, b: String): String
6163
= ???
6264

63-
import scala.language.experimental.clauseInterleaving
64-
6565
def clauseInterleaving[T](x: T)[U](y: U)(using (T, U)): (T, U)
6666
= ???
6767

0 commit comments

Comments
 (0)