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

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

Issue 9963082: Dartc's 'can't use a type variable in static context' message now works the same way as 'NO_SUCH_TY… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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 | compiler/java/com/google/dart/compiler/resolver/TypeErrorCode.java » ('j') | 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 63ae895e43907dbe0e38ac585210b1e6af962a01..970d7984ffda0d57e6c6047da539af9afe88d96b 100644
--- a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
+++ b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
@@ -9,6 +9,7 @@ import com.google.dart.compiler.DartCompilerContext;
import com.google.dart.compiler.ErrorCode;
import com.google.dart.compiler.ErrorSeverity;
import com.google.dart.compiler.Source;
+import com.google.dart.compiler.SubSystem;
import com.google.dart.compiler.SystemLibraryManager;
import com.google.dart.compiler.ast.ASTVisitor;
import com.google.dart.compiler.ast.DartFunctionExpression;
@@ -234,8 +235,13 @@ public class ResolutionContext implements ResolutionErrorListener {
isFactory,
errorCode);
case NONE:
- onError(identifier, ResolverErrorCode.TYPE_VARIABLE_IN_STATIC_CONTEXT,
- identifier);
+ if (errorCode.getSubSystem().equals(SubSystem.RESOLVER)) {
+ onError(identifier, ResolverErrorCode.TYPE_VARIABLE_IN_STATIC_CONTEXT,
+ identifier);
+ } else {
+ onError(identifier, TypeErrorCode.TYPE_VARIABLE_IN_STATIC_CONTEXT,
+ identifier);
+ }
return typeProvider.getDynamicType();
default:
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/TypeErrorCode.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698