@@ -347,16 +347,19 @@ class Definitions {
347
347
348
348
lazy val ScalaPredefModuleRef : TermRef = ctx.requiredModuleRef(" scala.Predef" )
349
349
def ScalaPredefModule (implicit ctx : Context ): Symbol = ScalaPredefModuleRef .symbol
350
-
351
- lazy val Predef_ConformsR : TypeRef = ScalaPredefModule .requiredClass(" <:<" ).typeRef
352
- def Predef_Conforms (implicit ctx : Context ): Symbol = Predef_ConformsR .symbol
353
350
lazy val Predef_conformsR : TermRef = ScalaPredefModule .requiredMethodRef(nme.conforms_)
354
351
def Predef_conforms (implicit ctx : Context ): Symbol = Predef_conformsR .symbol
355
352
lazy val Predef_classOfR : TermRef = ScalaPredefModule .requiredMethodRef(nme.classOf )
356
353
def Predef_classOf (implicit ctx : Context ): Symbol = Predef_classOfR .symbol
357
354
lazy val Predef_undefinedR : TermRef = ScalaPredefModule .requiredMethodRef(nme.??? )
358
355
def Predef_undefined (implicit ctx : Context ): Symbol = Predef_undefinedR .symbol
359
356
357
+ def SubTypeClass (implicit ctx : Context ): Symbol =
358
+ if (isNewCollections)
359
+ ctx.requiredClass(" scala.<:<" )
360
+ else
361
+ ScalaPredefModule .requiredClass(" <:<" )
362
+
360
363
lazy val ScalaRuntimeModuleRef : TermRef = ctx.requiredModuleRef(" scala.runtime.ScalaRunTime" )
361
364
def ScalaRuntimeModule (implicit ctx : Context ): Symbol = ScalaRuntimeModuleRef .symbol
362
365
def ScalaRuntimeClass (implicit ctx : Context ): ClassSymbol = ScalaRuntimeModule .moduleClass.asClass
@@ -397,8 +400,7 @@ class Definitions {
397
400
def newArrayMethod (implicit ctx : Context ): TermSymbol = DottyArraysModule .requiredMethod(" newArray" )
398
401
399
402
// TODO: Remove once we drop support for 2.12 standard library
400
- lazy val isNewCollections : Boolean = ctx.settings.YnewCollections .value ||
401
- ctx.base.staticRef(" scala.collection.IterableOnce" .toTypeName).exists
403
+ lazy val isNewCollections : Boolean = ctx.settings.YnewCollections .value
402
404
403
405
def getWrapVarargsArrayModule : Symbol = if (isNewCollections) ScalaRuntimeModule else ScalaPredefModule
404
406
@@ -585,7 +587,11 @@ class Definitions {
585
587
586
588
lazy val ThrowableType : TypeRef = ctx.requiredClassRef(" java.lang.Throwable" )
587
589
def ThrowableClass (implicit ctx : Context ): ClassSymbol = ThrowableType .symbol.asClass
588
- lazy val SerializableType : TypeRef = ctx.requiredClassRef(" scala.Serializable" )
590
+ lazy val SerializableType : TypeRef =
591
+ if (isNewCollections)
592
+ JavaSerializableClass .typeRef
593
+ else
594
+ ctx.requiredClassRef(" scala.Serializable" )
589
595
def SerializableClass (implicit ctx : Context ): ClassSymbol = SerializableType .symbol.asClass
590
596
lazy val StringBuilderType : TypeRef = ctx.requiredClassRef(" scala.collection.mutable.StringBuilder" )
591
597
def StringBuilderClass (implicit ctx : Context ): ClassSymbol = StringBuilderType .symbol.asClass
0 commit comments