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