@@ -1538,9 +1538,7 @@ class Definitions {
1538
1538
denot.sourceModule.info = denot.typeRef // we run into a cyclic reference when patching if this line is omitted
1539
1539
patch2(denot, patchCls)
1540
1540
1541
- if ctx.settings.YcompileScala2Library .value then
1542
- ()
1543
- else if denot.name == tpnme.Predef .moduleClassName && denot.symbol == ScalaPredefModuleClass then
1541
+ if denot.name == tpnme.Predef .moduleClassName && denot.symbol == ScalaPredefModuleClass then
1544
1542
patchWith(ScalaPredefModuleClassPatch )
1545
1543
else if denot.name == tpnme.language.moduleClassName && denot.symbol == LanguageModuleClass then
1546
1544
patchWith(LanguageModuleClassPatch )
@@ -1883,7 +1881,7 @@ class Definitions {
1883
1881
|| tp.derivesFrom(defn.PolyFunctionClass ) // TODO check for refinement?
1884
1882
1885
1883
private def withSpecMethods (cls : ClassSymbol , bases : List [Name ], paramTypes : Set [TypeRef ]) =
1886
- if ! ctx.settings. YcompileScala2Library .value then
1884
+ if ! Feature .shouldBehaveAsScala2 then
1887
1885
for base <- bases; tp <- paramTypes do
1888
1886
cls.enter(newSymbol(cls, base.specializedName(List (tp)), Method , ExprType (tp)))
1889
1887
cls
@@ -1926,7 +1924,7 @@ class Definitions {
1926
1924
case List (x, y) => Tuple2SpecializedParamClasses ().contains(x.classSymbol) && Tuple2SpecializedParamClasses ().contains(y.classSymbol)
1927
1925
case _ => false
1928
1926
&& base.owner.denot.info.member(base.name.specializedName(args)).exists // when dotc compiles the stdlib there are no specialised classes
1929
- && ! ctx.settings. YcompileScala2Library .value // We do not add the specilized TupleN methods/classes when compiling the stdlib
1927
+ && ! Feature .shouldBehaveAsScala2 // We do not add the specilized TupleN methods/classes when compiling the stdlib
1930
1928
1931
1929
def isSpecializableFunction (cls : ClassSymbol , paramTypes : List [Type ], retType : Type )(using Context ): Boolean =
1932
1930
paramTypes.length <= 2
@@ -1948,7 +1946,7 @@ class Definitions {
1948
1946
case _ =>
1949
1947
false
1950
1948
})
1951
- && ! ctx.settings. YcompileScala2Library .value // We do not add the specilized FunctionN methods/classes when compiling the stdlib
1949
+ && ! Feature .shouldBehaveAsScala2 // We do not add the specilized FunctionN methods/classes when compiling the stdlib
1952
1950
1953
1951
@ tu lazy val Function0SpecializedApplyNames : List [TermName ] =
1954
1952
for r <- Function0SpecializedReturnTypes
0 commit comments