@@ -1250,30 +1250,6 @@ trait Checking {
12501250 def checkDerivedValueClass (clazz : Symbol , stats : List [Tree ])(using Context ): Unit =
12511251 Checking .checkDerivedValueClass(clazz, stats)
12521252
1253- /** Given a parent `parent` of a class `cls`, if `parent` is a trait check that
1254- * the superclass of `cls` derived from the superclass of `parent`.
1255- *
1256- * An exception is made if `cls` extends `Any`, and `parent` is `java.io.Serializable`
1257- * or `java.lang.Comparable`. These two classes are treated by Scala as universal
1258- * traits. E.g. the following is OK:
1259- *
1260- * ... extends Any with java.io.Serializable
1261- *
1262- * The standard library relies on this idiom.
1263- */
1264- def checkTraitInheritance (parent : Symbol , cls : ClassSymbol , pos : SrcPos )(using Context ): Unit =
1265- parent match {
1266- case parent : ClassSymbol if parent.is(Trait ) =>
1267- val psuper = parent.superClass
1268- val csuper = cls.superClass
1269- val ok = csuper.derivesFrom(psuper) ||
1270- parent.is(JavaDefined ) && csuper == defn.AnyClass &&
1271- (parent == defn.JavaSerializableClass || parent == defn.ComparableClass )
1272- if (! ok)
1273- report.error(em " illegal trait inheritance: super $csuper does not derive from $parent's super $psuper" , pos)
1274- case _ =>
1275- }
1276-
12771253 /** Check that case classes are not inherited by case classes.
12781254 */
12791255 def checkCaseInheritance (parent : Symbol , caseCls : ClassSymbol , pos : SrcPos )(using Context ): Unit =
@@ -1650,7 +1626,6 @@ trait NoChecking extends ReChecking {
16501626 override def checkParentCall (call : Tree , caller : ClassSymbol )(using Context ): Unit = ()
16511627 override def checkSimpleKinded (tpt : Tree )(using Context ): Tree = tpt
16521628 override def checkDerivedValueClass (clazz : Symbol , stats : List [Tree ])(using Context ): Unit = ()
1653- override def checkTraitInheritance (parentSym : Symbol , cls : ClassSymbol , pos : SrcPos )(using Context ): Unit = ()
16541629 override def checkCaseInheritance (parentSym : Symbol , caseCls : ClassSymbol , pos : SrcPos )(using Context ): Unit = ()
16551630 override def checkNoForwardDependencies (vparams : List [ValDef ])(using Context ): Unit = ()
16561631 override def checkMembersOK (tp : Type , pos : SrcPos )(using Context ): Type = tp
0 commit comments