Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1238)

Unified Diff: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java

Issue 10910142: Issue 4988. Fixe for 'assert' statement vs function resolving (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak for artificial 'assert' function name Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
index 85eced086f74f29387e49bf38da26c6870abf6b9..a3956a14f465c0649d8136032ee814314627dd02 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -1633,23 +1633,6 @@ public class TypeAnalyzer implements DartCompilationPhase {
}
@Override
- public Type visitExprStmt(DartExprStmt node) {
- // special support for incomplete "assert"
- if (node.getExpression() instanceof DartIdentifier) {
- DartIdentifier identifier = (DartIdentifier) node.getExpression();
- NodeElement element = identifier.getElement();
- if (Objects.equal(identifier.getName(), "assert")
- && Elements.isArtificialAssertMethod(element)) {
- onError(node, TypeErrorCode.ASSERT_NUMBER_ARGUMENTS);
- return voidType;
- }
- }
- // normal
- typeOf(node.getExpression());
- return voidType;
- }
-
- @Override
public Type visitFieldDefinition(DartFieldDefinition node) {
node.visitChildren(this);
return voidType;
@@ -2552,10 +2535,9 @@ public class TypeAnalyzer implements DartCompilationPhase {
restoreOnBlockExit.put(restoreBlock, variableRestorer);
inferVariableTypesFromIsConditions(condition, variableRestorer);
}
- } else {
- onError(node, TypeErrorCode.ASSERT_NUMBER_ARGUMENTS);
+ // done for "assert"
+ return voidType;
}
- return voidType;
}
// normal invocation
Type type;

Powered by Google App Engine
This is Rietveld 408576698