-
Notifications
You must be signed in to change notification settings - Fork 13
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
Get arithmetic operation kind for compound assignments #388
Conversation
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.
Thanks @d367wang !
@@ -155,7 +155,7 @@ | |||
* @return the ArithmeticVariableSlot for the given location | |||
*/ | |||
ArithmeticVariableSlot createArithmeticVariableSlot( | |||
AnnotationLocation location, AnnotatedTypeMirror lhsAtm, AnnotatedTypeMirror rhsAtm); | |||
AnnotationLocation location, TypeMirror lhs, TypeMirror rhs); |
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.
The names/comments in the javadoc above also need to be updated.
@@ -601,7 +598,7 @@ private TypeKind getArithmeticResultKind(AnnotatedTypeMirror lhsAtm, AnnotatedTy | |||
|
|||
@Override | |||
public ArithmeticVariableSlot createArithmeticVariableSlot( | |||
AnnotationLocation location, AnnotatedTypeMirror lhsAtm, AnnotatedTypeMirror rhsAtm) { | |||
AnnotationLocation location, TypeMirror lhs, TypeMirror rhs) { |
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.
Why are there no calls to this method that need to be changed?
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.
Because ArithmeticVariableSlot
s are only created in the value-inference downstream
@@ -577,14 +577,11 @@ public ExistentialVariableSlot createExistentialVariableSlot(Slot potentialSlot, | |||
|
|||
/** | |||
* Determine the type kind of an arithmetic operation, based on Binary Numeric Promotion in JLS 5.6.2. | |||
* @param lhsAtm atm of left operand | |||
* @param rhsAtm atm of right operand | |||
* @param lhsType type of left operand |
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.
Could you break this PR into two, one for compound assignments and one for these parameter type changes?
Co-authored-by: Werner Dietl <wdietl@gmail.com>
…inference into value-patch-1
@d367wang Thanks! Is there a follow-up PR for the |
A split of #331
SlotManager.createArithmeticVariableSlot
Co-authored-by: Jenny Xiang j.tt.xiang@gmail.com