-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix mapping of annotations containing defs
- Loading branch information
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[[syntax trees at end of typer]] // tests/printing/dependent-annot-19846.scala | ||
package <empty> { | ||
class lambdaAnnot(g: () => Int) extends scala.annotation.Annotation(), | ||
annotation.StaticAnnotation { | ||
private[this] val g: () => Int | ||
} | ||
final lazy module val Test: Test = new Test() | ||
final module class Test() extends Object() { this: Test.type => | ||
val y: Int = ??? | ||
val z: | ||
Int @lambdaAnnot( | ||
{ | ||
def $anonfun(): Int = Test.y | ||
closure($anonfun) | ||
} | ||
) | ||
= f(Test.y) | ||
} | ||
final lazy module val dependent-annot-19846$package: | ||
dependent-annot-19846$package = new dependent-annot-19846$package() | ||
final module class dependent-annot-19846$package() extends Object() { | ||
this: dependent-annot-19846$package.type => | ||
def f(x: Int): | ||
Int @lambdaAnnot( | ||
{ | ||
def $anonfun(): Int = x | ||
closure($anonfun) | ||
} | ||
) | ||
= x | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class lambdaAnnot(g: () => Int) extends annotation.StaticAnnotation | ||
def f(x: Int): Int @lambdaAnnot(() => x) = x | ||
object Test: | ||
val y: Int = ??? | ||
val z /*: Int @lambdaAnnot(() => y) */ = f(y) |