We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 99d0802 + bc207ad commit a163c3fCopy full SHA for a163c3f
compiler/src/dotty/tools/dotc/core/TypeOps.scala
@@ -511,7 +511,7 @@ object TypeOps:
511
@threadUnsafe lazy val forbidden = symsToAvoid.toSet
512
def toAvoid(tp: NamedType) =
513
val sym = tp.symbol
514
- !sym.isStatic && forbidden.contains(sym)
+ forbidden.contains(sym)
515
516
override def apply(tp: Type): Type = tp match
517
case tp: TypeVar if mapCtx.typerState.constraint.contains(tp) =>
tests/pos/i9314.scala
@@ -0,0 +1,4 @@
1
+final class fooAnnot[T](member: T) extends scala.annotation.StaticAnnotation // must have type parameter
2
+
3
+@fooAnnot(new RecAnnotated {}) // must pass instance of anonymous subclass
4
+trait RecAnnotated
0 commit comments