File tree 3 files changed +12
-1
lines changed
compiler/src/dotty/tools/dotc/core
library/src/scala/annotation
3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -803,6 +803,7 @@ class Definitions {
803
803
@ tu lazy val ScalaStrictFPAnnot : ClassSymbol = ctx.requiredClass(" scala.annotation.strictfp" )
804
804
@ tu lazy val ScalaStaticAnnot : ClassSymbol = ctx.requiredClass(" scala.annotation.static" )
805
805
@ tu lazy val SerialVersionUIDAnnot : ClassSymbol = ctx.requiredClass(" scala.SerialVersionUID" )
806
+ @ tu lazy val SuperTraitAnnot : ClassSymbol = ctx.requiredClass(" scala.annotation.superTrait" )
806
807
@ tu lazy val TASTYSignatureAnnot : ClassSymbol = ctx.requiredClass(" scala.annotation.internal.TASTYSignature" )
807
808
@ tu lazy val TASTYLongSignatureAnnot : ClassSymbol = ctx.requiredClass(" scala.annotation.internal.TASTYLongSignature" )
808
809
@ 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 {
1168
1168
1169
1169
final def isSuperTrait (using Context ): Boolean =
1170
1170
isClass
1171
- && (is(SuperTrait ) || defn.assumedSuperTraits.contains(symbol.asClass))
1171
+ && (is(SuperTrait )
1172
+ || defn.assumedSuperTraits.contains(symbol.asClass)
1173
+ || hasAnnotation(defn.SuperTraitAnnot ))
1172
1174
1173
1175
/** The class containing this denotation which has the given effective name. */
1174
1176
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