From 32ead8d136331bcd24361981d88b7efe763f5e25 Mon Sep 17 00:00:00 2001 From: "scheglov@google.com" Date: Wed, 5 Sep 2012 03:36:50 +0000 Subject: [PATCH] Issue 4903. Better error message when static method attempts to use type variable http://code.google.com/p/dart/issues/detail?id=4903 R=brianwilkerson@google.com BUG= Review URL: https://chromiumcodereview.appspot.com//10911087 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11860 260f80e4-7a28-3924-810f-c04153c831b5 --- .../dart/compiler/resolver/ResolutionContext.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java index 8e194c66631..da00fd787ab 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);