-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #2797: Don't lift Java annotation arguments out of call #2819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c5f98c0
Workaround #2797 by removing an assertion
OlivierBlanvillain b6618f6
Minor spacing & formating
OlivierBlanvillain 4b6e15c
Move getter/setter annotation to the underlying field
OlivierBlanvillain 579dd1d
Don't lift arguments out of Java annotation constructors
odersky a1b6c3e
Workaround #2797 by removing an assertion (reverted from commit e83ac…
odersky 546c59f
Fix handling of defaults in Java annotations
odersky a02b10b
Move test to pending
odersky c15ff7b
Add Scala test case
odersky 7a35bf8
Fix typo in docs
odersky a707a74
Fix test i2797
smarter bc2b6c3
Disable i2797 again
smarter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,7 @@ | ||
// Test is pending because we have no good way to test it. | ||
// We need to: Compile Fork.java, and then compile Test.scala | ||
// with Fork.class on the classpath. | ||
public @interface Fork_1 { | ||
int value() default -1; | ||
String[] jvmArgs() default { "nope" }; | ||
} |
This file contains hidden or 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 @@ | ||
// Test is pending because we have no good way to test it. | ||
// We need to: Compile Fork.java, and then compile Test.scala | ||
// with Fork.class on the classpath. | ||
@Fork_1(jvmArgs = Array("I'm", "hot")) | ||
class Test |
This file contains hidden or 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 @@ | ||
// Test is pending because we have no good way to test it. | ||
// We need to: Compile Fork.java, and then compile Test.scala | ||
// with Fork.class on the classpath. | ||
class Fork(value: Int = -1, jvmArgs: Array[String] = Array("nope")) | ||
extends annotation.Annotation |
This file contains hidden or 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 @@ | ||
// Test is pending because we have no good way to test it. | ||
// We need to: Compile Fork.java, and then compile Test.scala | ||
// with Fork.class on the classpath. | ||
@Fork(jvmArgs = Array("I'm", "hot")) | ||
class Test |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this test is pending, since Fork is suffixed with 1 and Test with 2, they should be compiled as you want
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are not. I get: "Not found: Fork" when I compile Test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed the test. The issue was that the annotation needed to be called
Fork_1
since the name of the file isFork_1.java
. The javac error messages are eaten by our test suite, there's a WIP PR to fix that at #2811There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good to know.