File tree 3 files changed +39
-1
lines changed
compiler/src/dotty/tools/dotc/core
3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ object Annotations {
62
62
if tm.isRange(x) then x
63
63
else
64
64
val tp1 = tm(tree.tpe)
65
- foldOver(if tp1 frozen_ =:= tree.tpe then x else tp1, tree)
65
+ foldOver(if tp1 eq tree.tpe then x else tp1, tree)
66
66
val diff = findDiff(NoType , args)
67
67
if tm.isRange(diff) then EmptyAnnotation
68
68
else if diff.exists then derivedAnnotation(tm.mapOver(tree))
Original file line number Diff line number Diff line change
1
+ [[syntax trees at end of typer]] // tests/printing/dependent-annot-19846.scala
2
+ package <empty> {
3
+ class lambdaAnnot(g: () => Int) extends scala.annotation.Annotation(),
4
+ annotation.StaticAnnotation {
5
+ private[this] val g: () => Int
6
+ }
7
+ final lazy module val Test: Test = new Test()
8
+ final module class Test() extends Object() { this: Test.type =>
9
+ val y: Int = ???
10
+ val z:
11
+ Int @lambdaAnnot(
12
+ {
13
+ def $anonfun(): Int = Test.y
14
+ closure($anonfun)
15
+ }
16
+ )
17
+ = f(Test.y)
18
+ }
19
+ final lazy module val dependent-annot-19846$package:
20
+ dependent-annot-19846$package = new dependent-annot-19846$package()
21
+ final module class dependent-annot-19846$package() extends Object() {
22
+ this: dependent-annot-19846$package.type =>
23
+ def f(x: Int):
24
+ Int @lambdaAnnot(
25
+ {
26
+ def $anonfun(): Int = x
27
+ closure($anonfun)
28
+ }
29
+ )
30
+ = x
31
+ }
32
+ }
33
+
Original file line number Diff line number Diff line change
1
+ class lambdaAnnot (g : () => Int ) extends annotation.StaticAnnotation
2
+ def f (x : Int ): Int @ lambdaAnnot(() => x) = x
3
+ object Test :
4
+ val y : Int = ???
5
+ val z /* : Int @lambdaAnnot(() => y) */ = f(y)
You can’t perform that action at this time.
0 commit comments