@@ -348,16 +348,19 @@ class Definitions {
348348
349349 lazy val ScalaPredefModuleRef : TermRef = ctx.requiredModuleRef(" scala.Predef" )
350350 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
354351 lazy val Predef_conformsR : TermRef = ScalaPredefModule .requiredMethodRef(nme.conforms_)
355352 def Predef_conforms (implicit ctx : Context ): Symbol = Predef_conformsR .symbol
356353 lazy val Predef_classOfR : TermRef = ScalaPredefModule .requiredMethodRef(nme.classOf )
357354 def Predef_classOf (implicit ctx : Context ): Symbol = Predef_classOfR .symbol
358355 lazy val Predef_undefinedR : TermRef = ScalaPredefModule .requiredMethodRef(nme.??? )
359356 def Predef_undefined (implicit ctx : Context ): Symbol = Predef_undefinedR .symbol
360357
358+ def SubTypeClass (implicit ctx : Context ): Symbol =
359+ if (isNewCollections)
360+ ctx.requiredClass(" scala.<:<" )
361+ else
362+ ScalaPredefModule .requiredClass(" <:<" )
363+
361364 lazy val ScalaRuntimeModuleRef : TermRef = ctx.requiredModuleRef(" scala.runtime.ScalaRunTime" )
362365 def ScalaRuntimeModule (implicit ctx : Context ): Symbol = ScalaRuntimeModuleRef .symbol
363366 def ScalaRuntimeClass (implicit ctx : Context ): ClassSymbol = ScalaRuntimeModule .moduleClass.asClass
@@ -395,8 +398,7 @@ class Definitions {
395398 def newArrayMethod (implicit ctx : Context ): TermSymbol = DottyArraysModule .requiredMethod(" newArray" )
396399
397400 // 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
400402
401403 def getWrapVarargsArrayModule : Symbol = if (isNewCollections) ScalaRuntimeModule else ScalaPredefModule
402404
@@ -583,7 +585,11 @@ class Definitions {
583585
584586 lazy val ThrowableType : TypeRef = ctx.requiredClassRef(" java.lang.Throwable" )
585587 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" )
587593 def SerializableClass (implicit ctx : Context ): ClassSymbol = SerializableType .symbol.asClass
588594 lazy val StringBuilderType : TypeRef = ctx.requiredClassRef(" scala.collection.mutable.StringBuilder" )
589595 def StringBuilderClass (implicit ctx : Context ): ClassSymbol = StringBuilderType .symbol.asClass
0 commit comments