Skip to content

Commit bc207ad

Browse files
committed
Remove isStatic check from TypeOps.avoid
fixes #9314
1 parent 65a86ae commit bc207ad

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

compiler/src/dotty/tools/dotc/core/TypeOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ object TypeOps:
512512
@threadUnsafe lazy val forbidden = symsToAvoid.toSet
513513
def toAvoid(tp: NamedType) =
514514
val sym = tp.symbol
515-
!sym.isStatic && forbidden.contains(sym)
515+
forbidden.contains(sym)
516516

517517
override def apply(tp: Type): Type = tp match
518518
case tp: TypeVar if mapCtx.typerState.constraint.contains(tp) =>

tests/pos/i9314.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)