-
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.
Do not lift annotation arguments (bis) (#22046)
Completing #22035; we also need to special case `TypedApply`. However, we don't systemically create `NamedArgs` there if the annotation is not a Java annotation, hence the two sperate cases.
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
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
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 |
---|---|---|
@@ -1,5 +1,15 @@ | ||
class annot(x: Any, y: Any = 42) extends annotation.Annotation | ||
class annot2(x: Any = -1, y: Array[Any] = Array("Hello")) extends annotation.Annotation | ||
|
||
def f(x: Int): Int @annot(x) = x | ||
def f2(x: Int): Int @annot2(y = Array("Hello", x)) = x | ||
|
||
def test = | ||
val y: Int = ??? | ||
|
||
val z = f(y) | ||
val z2 = f2(y) | ||
|
||
@annot(44) val z3 = 45 | ||
@annot2(y = Array("Hello", y)) val z4 = 45 | ||
|