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.
1 parent 65a86ae commit bc207adCopy full SHA for bc207ad
compiler/src/dotty/tools/dotc/core/TypeOps.scala
@@ -512,7 +512,7 @@ object TypeOps:
512
@threadUnsafe lazy val forbidden = symsToAvoid.toSet
513
def toAvoid(tp: NamedType) =
514
val sym = tp.symbol
515
- !sym.isStatic && forbidden.contains(sym)
+ forbidden.contains(sym)
516
517
override def apply(tp: Type): Type = tp match
518
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