@@ -347,16 +347,19 @@ class Definitions {
347347
348348 lazy val ScalaPredefModuleRef : TermRef = ctx.requiredModuleRef(" scala.Predef" )
349349 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
353350 lazy val Predef_conformsR : TermRef = ScalaPredefModule .requiredMethodRef(nme.conforms_)
354351 def Predef_conforms (implicit ctx : Context ): Symbol = Predef_conformsR .symbol
355352 lazy val Predef_classOfR : TermRef = ScalaPredefModule .requiredMethodRef(nme.classOf )
356353 def Predef_classOf (implicit ctx : Context ): Symbol = Predef_classOfR .symbol
357354 lazy val Predef_undefinedR : TermRef = ScalaPredefModule .requiredMethodRef(nme.??? )
358355 def Predef_undefined (implicit ctx : Context ): Symbol = Predef_undefinedR .symbol
359356
357+ def SubTypeClass (implicit ctx : Context ): Symbol =
358+ if (isNewCollections)
359+ ctx.requiredClass(" scala.<:<" )
360+ else
361+ ScalaPredefModule .requiredClass(" <:<" )
362+
360363 lazy val ScalaRuntimeModuleRef : TermRef = ctx.requiredModuleRef(" scala.runtime.ScalaRunTime" )
361364 def ScalaRuntimeModule (implicit ctx : Context ): Symbol = ScalaRuntimeModuleRef .symbol
362365 def ScalaRuntimeClass (implicit ctx : Context ): ClassSymbol = ScalaRuntimeModule .moduleClass.asClass
@@ -397,8 +400,7 @@ class Definitions {
397400 def newArrayMethod (implicit ctx : Context ): TermSymbol = DottyArraysModule .requiredMethod(" newArray" )
398401
399402 // 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
402404
403405 def getWrapVarargsArrayModule : Symbol = if (isNewCollections) ScalaRuntimeModule else ScalaPredefModule
404406
@@ -585,7 +587,11 @@ class Definitions {
585587
586588 lazy val ThrowableType : TypeRef = ctx.requiredClassRef(" java.lang.Throwable" )
587589 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" )
589595 def SerializableClass (implicit ctx : Context ): ClassSymbol = SerializableType .symbol.asClass
590596 lazy val StringBuilderType : TypeRef = ctx.requiredClassRef(" scala.collection.mutable.StringBuilder" )
591597 def StringBuilderClass (implicit ctx : Context ): ClassSymbol = StringBuilderType .symbol.asClass
0 commit comments