fix codegen after JetWhenConditionWithExpression removal
This commit is contained in:
@@ -1642,8 +1642,9 @@ public class ExpressionCodegen extends JetVisitor {
|
|||||||
expressionToMatch.dupReceiver(v, 0);
|
expressionToMatch.dupReceiver(v, 0);
|
||||||
expressionToMatch.put(subjectType, v);
|
expressionToMatch.put(subjectType, v);
|
||||||
JetExpression condExpression = ((JetExpressionPattern) pattern).getExpression();
|
JetExpression condExpression = ((JetExpressionPattern) pattern).getExpression();
|
||||||
gen(condExpression, OBJECT_TYPE);
|
Type condType = isNumberPrimitive(subjectType) ? expressionType(condExpression) : OBJECT_TYPE;
|
||||||
generateEqualsForExpressionsOnStack(JetTokens.EQEQ, subjectType, OBJECT_TYPE);
|
gen(condExpression, condType);
|
||||||
|
generateEqualsForExpressionsOnStack(JetTokens.EQEQ, subjectType, condType);
|
||||||
return myStack.pop();
|
return myStack.pop();
|
||||||
}
|
}
|
||||||
else if (pattern instanceof JetWildcardPattern) {
|
else if (pattern instanceof JetWildcardPattern) {
|
||||||
@@ -1837,15 +1838,6 @@ public class ExpressionCodegen extends JetVisitor {
|
|||||||
private StackValue generateWhenCondition(Type subjectType, int subjectLocal, JetWhenCondition condition,
|
private StackValue generateWhenCondition(Type subjectType, int subjectLocal, JetWhenCondition condition,
|
||||||
@Nullable Label nextEntry) {
|
@Nullable Label nextEntry) {
|
||||||
StackValue conditionValue;
|
StackValue conditionValue;
|
||||||
// if (condition instanceof JetWhenConditionWithExpression) {
|
|
||||||
// v.load(subjectLocal, subjectType);
|
|
||||||
// JetExpression condExpression = ((JetWhenConditionWithExpression) condition).getExpression();
|
|
||||||
// Type condType = isNumberPrimitive(subjectType) ? expressionType(condExpression) : OBJECT_TYPE;
|
|
||||||
// gen(condExpression, condType);
|
|
||||||
// generateEqualsForExpressionsOnStack(JetTokens.EQEQ, subjectType, condType);
|
|
||||||
// conditionValue = myStack.pop();
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
if (condition instanceof JetWhenConditionInRange) {
|
if (condition instanceof JetWhenConditionInRange) {
|
||||||
JetExpression range = ((JetWhenConditionInRange) condition).getRangeExpression();
|
JetExpression range = ((JetWhenConditionInRange) condition).getRangeExpression();
|
||||||
gen(range, RANGE_TYPE);
|
gen(range, RANGE_TYPE);
|
||||||
|
|||||||
Reference in New Issue
Block a user