Skip to content

Commit

Permalink
fixed files form Closure #6
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent 368d90e commit cf3aceb
Showing 1 changed file with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,6 @@ boolean expectCanAssignToPropertyOf(NodeTraversal t, Node n, JSType rightType,
JSType leftType, Node owner, String propName) {
// The NoType check is a hack to make typedefs work OK.
if (!leftType.isNoType() && !rightType.canAssignTo(leftType)) {
if ((leftType.isConstructor() || leftType.isEnumType()) && (rightType.isConstructor() || rightType.isEnumType())) {
registerMismatch(rightType, leftType, null);
} else {
// Do not type-check interface methods, because we expect that
// they will have dummy implementations that do not match the type
// annotations.
Expand All @@ -382,7 +379,6 @@ boolean expectCanAssignToPropertyOf(NodeTraversal t, Node n, JSType rightType,
"assignment to property " + propName + " of " +
getReadableJSTypeName(owner, true),
rightType, leftType);
}
return false;
}
return true;
Expand All @@ -402,11 +398,7 @@ boolean expectCanAssignToPropertyOf(NodeTraversal t, Node n, JSType rightType,
boolean expectCanAssignTo(NodeTraversal t, Node n, JSType rightType,
JSType leftType, String msg) {
if (!rightType.canAssignTo(leftType)) {
if ((leftType.isConstructor() || leftType.isEnumType()) && (rightType.isConstructor() || rightType.isEnumType())) {
registerMismatch(rightType, leftType, null);
} else {
mismatch(t, n, msg, rightType, leftType);
}
return false;
}
return true;
Expand Down

0 comments on commit cf3aceb

Please sign in to comment.