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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java

Issue 10911087: Issue 4903. Better error message when static method attempts to use type variable (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
index 8e194c66631a867ff4d426273a2291d4413849b1..da00fd787ab8f565950ba8aa61e2d69cb1989742 100644
--- a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
+++ b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
@@ -8,9 +8,9 @@ import com.google.dart.compiler.DartCompilationError;
import com.google.dart.compiler.DartCompilerContext;
import com.google.dart.compiler.ErrorCode;
import com.google.dart.compiler.ErrorSeverity;
+import com.google.dart.compiler.PackageLibraryManager;
import com.google.dart.compiler.Source;
import com.google.dart.compiler.SubSystem;
-import com.google.dart.compiler.PackageLibraryManager;
import com.google.dart.compiler.ast.ASTVisitor;
import com.google.dart.compiler.ast.DartFunctionExpression;
import com.google.dart.compiler.ast.DartFunctionTypeAlias;
@@ -243,6 +243,7 @@ public class ResolutionContext implements ResolutionErrorListener {
errorCode,
wrongNumberErrorCode);
case NONE:
+ default:
if (errorCode.getSubSystem().equals(SubSystem.RESOLVER)) {
onError(identifier, ResolverErrorCode.TYPE_VARIABLE_IN_STATIC_CONTEXT,
identifier);
@@ -251,14 +252,6 @@ public class ResolutionContext implements ResolutionErrorListener {
identifier);
}
return typeProvider.getDynamicType();
-
- default:
- if (errorCode.getSubSystem().equals(SubSystem.RESOLVER)) {
- onError(identifier, ResolverErrorCode.NOT_A_TYPE, identifier, elementKind);
- } else {
- onError(identifier, TypeErrorCode.NOT_A_TYPE, identifier, elementKind);
- }
- return typeProvider.getDynamicType();
}
}
return makeTypeVariable(typeVariableElement, typeArguments);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698