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 58a5620 + daef5f4 commit 4ac8511Copy full SHA for 4ac8511
compiler/src/dotty/tools/dotc/typer/Checking.scala
@@ -1129,7 +1129,7 @@ trait Checking {
1129
val preExisting = ctx.effectiveScope.lookup(ename)
1130
if (preExisting.exists || seen.contains(ename))
1131
ctx.error(em"@alpha annotation ${'"'}$ename${'"'} clashes with other definition is same scope", stat.sourcePos)
1132
- seen += ename
+ if stat.isDef then seen += ename
1133
}
1134
1135
tests/pos/i8391.scala
@@ -0,0 +1,13 @@
1
+import scala.annotation.alpha
2
+
3
+trait Foo {
4
+ @alpha("intersection")
5
+ def *(other: Foo): Foo
6
+}
7
8
+@main def Test() = {
9
+ val s: Foo = ???
10
+ s * s
11
12
13
0 commit comments