Skip to content

Commit 3f52210

Browse files
authored
Merge pull request scala#6730 from smarter/Cloneable-Serializable-part-1
Preparations for making Cloneable/Serializable aliases
2 parents d94d9bc + a41cb31 commit 3f52210

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/reflect/scala/reflect/internal/Definitions.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,12 @@ trait Definitions extends api.StandardDefinitions {
372372

373373
lazy val TypeConstraintClass = requiredClass[scala.annotation.TypeConstraint]
374374
lazy val SingletonClass = enterNewClass(ScalaPackageClass, tpnme.Singleton, AnyTpe :: Nil, ABSTRACT | TRAIT | FINAL) markAllCompleted
375-
lazy val SerializableClass = requiredClass[scala.Serializable]
375+
376+
// In the future (#6729) scala.Serializable will be a type alias to
377+
// java.io.Serializable. To be able to bootstrap this change, we need a
378+
// STARR that does not crash when this change is made.
379+
lazy val SerializableClass = getClassIfDefined("scala.Serializable").orElse(JavaSerializableClass)
380+
376381
lazy val JavaSerializableClass = requiredClass[java.io.Serializable] modifyInfo fixupAsAnyTrait
377382
lazy val ComparableClass = requiredClass[java.lang.Comparable[_]] modifyInfo fixupAsAnyTrait
378383
lazy val JavaCloneableClass = requiredClass[java.lang.Cloneable]

0 commit comments

Comments
 (0)