File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
compiler/src/dotty/tools/dotc/core
library/src/scala/annotation Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -803,6 +803,7 @@ class Definitions {
803803 @ tu lazy val ScalaStrictFPAnnot : ClassSymbol = ctx.requiredClass(" scala.annotation.strictfp" )
804804 @ tu lazy val ScalaStaticAnnot : ClassSymbol = ctx.requiredClass(" scala.annotation.static" )
805805 @ tu lazy val SerialVersionUIDAnnot : ClassSymbol = ctx.requiredClass(" scala.SerialVersionUID" )
806+ @ tu lazy val SuperTraitAnnot : ClassSymbol = ctx.requiredClass(" scala.annotation.superTrait" )
806807 @ tu lazy val TASTYSignatureAnnot : ClassSymbol = ctx.requiredClass(" scala.annotation.internal.TASTYSignature" )
807808 @ tu lazy val TASTYLongSignatureAnnot : ClassSymbol = ctx.requiredClass(" scala.annotation.internal.TASTYLongSignature" )
808809 @ tu lazy val TailrecAnnot : ClassSymbol = ctx.requiredClass(" scala.annotation.tailrec" )
Original file line number Diff line number Diff line change @@ -1168,7 +1168,9 @@ object SymDenotations {
11681168
11691169 final def isSuperTrait (using Context ): Boolean =
11701170 isClass
1171- && (is(SuperTrait ) || defn.assumedSuperTraits.contains(symbol.asClass))
1171+ && (is(SuperTrait )
1172+ || defn.assumedSuperTraits.contains(symbol.asClass)
1173+ || hasAnnotation(defn.SuperTraitAnnot ))
11721174
11731175 /** The class containing this denotation which has the given effective name. */
11741176 final def enclosingClassNamed (name : Name )(implicit ctx : Context ): Symbol = {
Original file line number Diff line number Diff line change 1+ package scala .annotation
2+
3+ /** Equivalent to declaring a super trait in Scala 3. This annotation
4+ * should be used only for files that need to cross-compile between
5+ * Scala 2 and 3.
6+ */
7+ final class superTrait extends StaticAnnotation
8+
You can’t perform that action at this time.
0 commit comments