-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support emitting "sourceType" diagnostics #36
Conversation
@wmdietl Does this new flag seem reasonable? Should it have a better name? Is this the kind of thing that EISOP would be able to support? |
@netdpb In EISOP we have the flag
Using that here is blocked by #29, but hopefully I'll wrap that up soon. |
I don't want to make extra work, but I also don't want to block the ability to write these new assertions. I'd like to continue with this approach, and then work to adapt the logic when we start depending on EISOP. Does that make sense? Separately, it looks like |
Sure.
You will get two messages for method calls, one with the declared type of the method and one with the use type of the method. class GenericCall {
<T> T id(T p) { return p; }
void foo() {
String s = id("hi");
}
} You'll get two messages for the call of
You would probably want the use type of the invoked method, as that is what needs to be compared against the call argument. |
Aha! This makes sense. I think that as long as the information is parsable so that it's possible to extract each parameter's information, that would be enough. |
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.
Looks good!
Add a new flag:
-AshowTypes
. When set, the type of each expression whose value is used in an assignment-like context is emitted as a warning, for use by conformance tests.In a future commit, the flag will also cause the expected type of the receiver to be emitted as well.