Merging equivalent case statements (OPTCHAIN_GETPROP, OPTCHAIN_CALL, OPTCHAIN_GETELEM)
@@ -633,6 +633,8 @@ public final class TypeCheck implements NodeTraversal.Callback, CompilerPass {
break;
case OPTCHAIN_GETPROP:
+ case OPTCHAIN_CALL:
+ case OPTCHAIN_GETELEM:
// TODO(b/151248857) Calculate appropriate type here
ensureTyped(n);
break;
@@ -645,11 +647,6 @@ public final class TypeCheck implements NodeTraversal.Callback, CompilerPass {
typeable = false;
break;
- case OPTCHAIN_GETELEM:
- // TODO(b/151248857) Calculate appropriate type here
- ensureTyped(n);
- break;
-
case VAR:
case LET:
case CONST:
@@ -666,11 +663,6 @@ public final class TypeCheck implements NodeTraversal.Callback, CompilerPass {
typeable = !parent.isExprResult();
break;
- case OPTCHAIN_CALL:
- // TODO(b/151248857) Calculate appropriate type here
- ensureTyped(n);
- break;
-
case RETURN:
visitReturn(t, n);
typeable = false;
