-
Notifications
You must be signed in to change notification settings - Fork 11
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
Apply String declaration bounds to String conversion nodes #207
Conversation
TypeMirror strType = n.getType(); | ||
|
||
Set<AnnotationMirror> operandAnnos = p.getValueOfSubNode(n.getOperand()).getAnnotations(); | ||
if (operandAnnos.isEmpty() && n.getOperand().getType().getKind() == TypeKind.TYPEVAR) { |
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.
What about wildcards?
Can you add test cases for both type variables and wildcards?
This change has no impact for the existing type systems, so can you add a simple test type system that illustrates the problem? How would a type system writer e.g. ensure that the operand type is not a supertype of the String declaration bound?
double check the tests without the "nomsgtext" flag |
duplicate of eisop#213 |
Previously, string conversion node gets the same value as its operand has. This behavior is error prone because the annotations of its operand could be the supertypes of String's declaration bounds. This PR fixes such issue using the following rules: