-
Notifications
You must be signed in to change notification settings - Fork 18
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
Don't erase the type argument of receiver #793
base: master
Are you sure you want to change the base?
Changes from 6 commits
ed8e47f
ab59a90
0df34f6
997dc5d
82c9faa
e160b61
a5d1fad
a4387a1
053340d
91dd74f
5768f2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* @test | ||
* @summary Test case for type argument in method invocation. | ||
* | ||
* @compile/fail/ref=NonRawTypeArgumentTest.out -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker NonRawTypeArgumentTest.java | ||
*/ | ||
public class NonRawTypeArgumentTest<T> { | ||
|
||
NonRawTypeArgumentTest() { | ||
foo(); | ||
} | ||
|
||
void foo() {} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
NonRawTypeArgumentTest.java:10:12: compiler.err.proc.messager: [method.invocation.invalid] call to foo() not allowed on the given receiver. | ||
found : @UnderInitialization(NonRawTypeArgumentTest.class) NonRawTypeArgumentTest<T extends @Initialized Object> | ||
required: @Initialized NonRawTypeArgumentTest<T extends @Initialized Object> | ||
1 error |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3772,7 +3772,7 @@ protected void checkMethodInvocability( | |
return; | ||
} | ||
|
||
AnnotatedTypeMirror methodReceiver = method.getReceiverType().getErased(); | ||
AnnotatedTypeMirror methodReceiver = method.getReceiverType(); | ||
AnnotatedTypeMirror treeReceiver = methodReceiver.shallowCopy(false); | ||
AnnotatedTypeMirror rcv = atypeFactory.getReceiverType(tree); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The subtype test below is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will look into #104 after this PR. |
||
|
||
|
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 find this summary confusing and don't see how this matches the code - there is no type argument there.
You need to say something about what type argument you mean.
Same with the test name 'NonRawTypeArgument` isn't very helpful - all type arguments are non-raw, otherwise there wouldn't be type arguments...