forked from typetools/checker-framework
-
Notifications
You must be signed in to change notification settings - Fork 29
Don't use erased type for diagnostic output #1604
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
13 commits
Select commit
Hold shift + click to select a range
6a93798
Report type arguments in method invocation
aosen-xiong 5c720a5
Merge branch 'master' into better-error-message
aosen-xiong 520fd92
Empty line at the end
aosen-xiong e12bb14
Improve test case
aosen-xiong 317d1ce
Call 'getErased'
aosen-xiong 07cad9c
Merge branch 'master' into better-error-message
aosen-xiong 5e7619f
Changelog
aosen-xiong 27fe900
Revert
aosen-xiong f71ed77
Apply suggestion from @wmdietl
aosen-xiong 70a355b
Use the variable already defined
aosen-xiong 37942c1
Revert changes and use full type the diagnostic
aosen-xiong 9afd466
Merge branch 'master' into better-error-message
aosen-xiong f84a661
Introduce local variable
aosen-xiong 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
checker/jtreg/nullness/MethodReceiverTypeErrorMessageTest.java
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,20 @@ | ||
| /* | ||
| * @test | ||
| * @summary Test case for method receiver type in error message. If it is a non-raw type, it should be printed as such. | ||
| * | ||
| * @compile/fail/ref=MethodReceiverTypeErrorMessageTest.out -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker MethodReceiverTypeErrorMessageTest.java | ||
| */ | ||
| public class MethodReceiverTypeErrorMessageTest<T> { | ||
|
|
||
| MethodReceiverTypeErrorMessageTest() { | ||
| foo(); | ||
| } | ||
|
|
||
| void foo() {} | ||
|
|
||
| static class StringSpecialization extends MethodReceiverTypeErrorMessageTest<String> { | ||
| StringSpecialization() { | ||
| foo(); | ||
| } | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
checker/jtreg/nullness/MethodReceiverTypeErrorMessageTest.out
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 @@ | ||
| MethodReceiverTypeErrorMessageTest.java:10:12: compiler.err.proc.messager: [method.invocation.invalid] call to foo() not allowed on the given receiver. | ||
| found : @UnderInitialization(MethodReceiverTypeErrorMessageTest.class) MethodReceiverTypeErrorMessageTest<T extends @Initialized Object> | ||
| required: @Initialized MethodReceiverTypeErrorMessageTest<T extends @Initialized Object> | ||
| MethodReceiverTypeErrorMessageTest.java:17:16: compiler.err.proc.messager: [method.invocation.invalid] call to foo() not allowed on the given receiver. | ||
| found : @UnderInitialization(MethodReceiverTypeErrorMessageTest.StringSpecialization.class) StringSpecialization | ||
| required: @Initialized MethodReceiverTypeErrorMessageTest<@Initialized String> | ||
| 2 errors |
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
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.
Uh oh!
There was an error while loading. Please reload this page.