Skip to content

Commit

Permalink
Use Var.isParam() rather than Var.getParent().isParamList() to check …
Browse files Browse the repository at this point in the history
…whether a variable is a parameter.

With destructuring and default values, the param list may not be the direct parent of the parameter anymore.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169432059
  • Loading branch information
tbreisacher authored and blickly committed Sep 20, 2017
1 parent 1515e10 commit bcd3987
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -303,7 +303,7 @@ private UndiGraph<Var, Void> computeVariableNamesInterferenceGraph(
continue NEXT_VAR_PAIR;
}

if (v1.getParentNode().isParamList() && v2.getParentNode().isParamList()) {
if (v1.isParam() && v2.isParam()) {
interferenceGraph.connectIfNotFound(v1, null, v2);
continue NEXT_VAR_PAIR;
}
Expand Down
Expand Up @@ -323,8 +323,8 @@ public void testBug1401831() {

// Code inside a class is automatically in strict mode, so duplicated parameter names are not
// allowed.
// TODO(b/64898400): Fix and enable this test.
public void disabled_testBug64898400() {
public void testBug64898400() {
testSame("class C { f(a, b, c) {} }");
testSame("class C { f(a, b=0, c=0) {} }");
}

Expand Down

0 comments on commit bcd3987

Please sign in to comment.