We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5f47bfd + ea9047a commit aaac006Copy full SHA for aaac006
tests/run/i13358.check
@@ -0,0 +1,8 @@
1
+1
2
3
4
5
+2
6
7
8
tests/run/i13358.scala
@@ -0,0 +1,22 @@
+object Test:
+ var cnt = 0
+
+ trait Foo:
+ lazy val foo1 = {cnt+=1; cnt}
+ @scala.annotation.targetName("fooTwo")
+ lazy val foo2 = {cnt+=1; cnt}
9
10
+ object Bar extends Foo
11
12
+ def main(sa: Array[String]): Unit =
13
14
+ println(Bar.foo1) // Prints 1
15
16
17
18
19
+ println(Bar.foo2) // Prints 2
20
+ println(Bar.foo2) // Prints 3 EXPECTED 2
21
+ println(Bar.foo2) // Prints 4 EXPECTED 2
22
+ println(Bar.foo2) // Prints 5 EXPECTED 2
0 commit comments