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