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

Side by Side Diff: compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java

Issue 10695067: Added a few tests, removed some error codes from Resolver (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: # Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 package com.google.dart.compiler.resolver; 4 package com.google.dart.compiler.resolver;
5 5
6 import com.google.dart.compiler.ErrorCode; 6 import com.google.dart.compiler.ErrorCode;
7 import com.google.dart.compiler.ErrorSeverity; 7 import com.google.dart.compiler.ErrorSeverity;
8 import com.google.dart.compiler.SubSystem; 8 import com.google.dart.compiler.SubSystem;
9 9
10 /** 10 /**
11 * {@link ErrorCode}s for resolver. 11 * {@link ErrorCode}s for resolver.
12 */ 12 */
13 public enum ResolverErrorCode implements ErrorCode { 13 public enum ResolverErrorCode implements ErrorCode {
14 BLACK_LISTED_EXTENDS("'%s' can not be used as superclass"), 14 BLACK_LISTED_EXTENDS("'%s' can not be used as superclass"),
15 BLACK_LISTED_IMPLEMENTS("'%s' can not be used as superinterface"), 15 BLACK_LISTED_IMPLEMENTS("'%s' can not be used as superinterface"),
16 BREAK_LABEL_RESOLVES_TO_CASE_OR_DEFAULT("break label resolves to case or defau lt statement"), 16 BREAK_LABEL_RESOLVES_TO_CASE_OR_DEFAULT("break label resolves to case or defau lt statement"),
17 BUILT_IN_IDENTIFIER_AS_IMPORT_PREFIX("Build-in identifier '%s' cannot be used as a import prefix"), 17 BUILT_IN_IDENTIFIER_AS_IMPORT_PREFIX("Build-in identifier '%s' cannot be used as a import prefix"),
18 BUILT_IN_IDENTIFIER_AS_TYPE("Build-in identifier '%s' cannot be used as a type annotation"), 18 BUILT_IN_IDENTIFIER_AS_TYPE("Build-in identifier '%s' cannot be used as a type annotation"),
19 // TODO(zundel): error message needs JUnit test
20 CANNOT_ACCESS_FIELD_IN_INIT("Cannot access an instance field in an initializer expression"), 19 CANNOT_ACCESS_FIELD_IN_INIT("Cannot access an instance field in an initializer expression"),
21 CANNOT_ACCESS_METHOD(ErrorSeverity.WARNING, "Cannot access private method '%s' "), 20 CANNOT_ACCESS_METHOD(ErrorSeverity.WARNING, "Cannot access private method '%s' "),
22 CANNOT_ACCESS_OUTER_LABEL("Cannot access label %s declared in an outer functio n"), 21 CANNOT_ACCESS_OUTER_LABEL("Cannot access label %s declared in an outer functio n"),
23 CANNOT_ASSIGN_TO_FINAL("cannot assign value to final variable \"%s\"."), 22 CANNOT_ASSIGN_TO_FINAL("cannot assign value to final variable \"%s\"."),
24 CANNOT_ASSIGN_TO_METHOD("cannot assign value to method '%s'."), 23 CANNOT_ASSIGN_TO_METHOD("cannot assign value to method '%s'."),
25 // TODO(zundel): error message needs JUnit test
26 CANNOT_BE_RESOLVED("cannot resolve %s"), 24 CANNOT_BE_RESOLVED("cannot resolve %s"),
27 // TODO(zundel): error message needs JUnit test 25 // TODO(zundel): error message needs JUnit test - how to test #imports in juni t?
28 CANNOT_BE_RESOLVED_LIBRARY("cannot resolve %s in library %s"), 26 CANNOT_BE_RESOLVED_LIBRARY("cannot resolve %s in library %s"),
29 // TODO(zundel): error message needs JUnit test
30 CANNOT_BE_INITIALIZED("cannot be initialized"),
31 // TODO(zundel): error message needs JUnit test
32 CANNOT_CALL_LABEL("Labels cannot be called"),
33 // TODO(zundel): error message needs JUnit test
34 CANNOT_CALL_FUNCTION_TYPE_ALIAS("Function type aliases cannot be called"), 27 CANNOT_CALL_FUNCTION_TYPE_ALIAS("Function type aliases cannot be called"),
35 // TODO(zundel): error message needs JUnit test 28 // TODO(zundel): error message needs JUnit test
36 CANNOT_CALL_LIBRARY_PREFIX("Library prefixes cannot be called"), 29 CANNOT_CALL_LIBRARY_PREFIX("Library prefixes cannot be called"),
37 CANNOT_DECLARE_NON_FACTORY_CONSTRUCTOR( 30 CANNOT_DECLARE_NON_FACTORY_CONSTRUCTOR(
38 "Cannot declare a non-factory named constructor of another class."), 31 "Cannot declare a non-factory named constructor of another class."),
39 CANNOT_HIDE_IMPORT_PREFIX("Cannot hide import prefix '%s'"), 32 CANNOT_HIDE_IMPORT_PREFIX("Cannot hide import prefix '%s'"),
40 CANNOT_INIT_STATIC_FIELD_IN_INITIALIZER("Cannot initialize a static field in a n initializer list"), 33 CANNOT_INIT_STATIC_FIELD_IN_INITIALIZER("Cannot initialize a static field in a n initializer list"),
41 // TODO(zundel): error message needs JUnit test 34 // TODO(zundel): error message needs JUnit test
42 CANNOT_OVERRIDE_INSTANCE_MEMBER("static member cannot override instance member %s of %s"), 35 CANNOT_OVERRIDE_INSTANCE_MEMBER("static member cannot override instance member %s of %s"),
43 CANNOT_OVERRIDE_METHOD_NUM_REQUIRED_PARAMS( 36 CANNOT_OVERRIDE_METHOD_NUM_REQUIRED_PARAMS(
44 "cannot override method %s, wrong number of required parameters"), 37 "cannot override method %s, wrong number of required parameters"),
45 CANNOT_OVERRIDE_METHOD_NAMED_PARAMS( 38 CANNOT_OVERRIDE_METHOD_NAMED_PARAMS(
46 "cannot override method %s, named parameters don't match"), 39 "cannot override method %s, named parameters don't match"),
47 // TODO(zundel): error message needs JUnit test 40 // TODO(zundel): error message needs JUnit test
48 CANNOT_RESOLVE_CONSTRUCTOR("cannot resolve constructor %s"), 41 CANNOT_RESOLVE_CONSTRUCTOR("cannot resolve constructor %s"),
49 // TODO(zundel): error message needs JUnit test 42 // TODO(zundel): error message needs JUnit test
50 CANNOT_RESOLVE_FIELD("cannot resolve field %s"), 43 CANNOT_RESOLVE_FIELD("cannot resolve field %s"),
51 CANNOT_RESOLVE_LABEL("cannot resolve label %s"), 44 CANNOT_RESOLVE_LABEL("cannot resolve label %s"),
52 CANNOT_RESOLVE_METHOD("cannot resolve method '%s'"), 45 CANNOT_RESOLVE_METHOD("cannot resolve method '%s'"),
53 CANNOT_RESOLVE_METHOD_IN_CLASS("cannot resolve method '%s' in class '%s'"), 46 CANNOT_RESOLVE_METHOD_IN_CLASS("cannot resolve method '%s' in class '%s'"),
54 // TODO(zundel): error message needs JUnit test 47 // TODO(zundel): error message needs JUnit test
55 CANNOT_RESOLVE_METHOD_IN_LIBRARY("cannot resolve method '%s' in library '%s'") , 48 CANNOT_RESOLVE_METHOD_IN_LIBRARY("cannot resolve method '%s' in library '%s'") ,
49 // TODO(zundel): To exercise this requires simulating a corrupted SDK?
50 CANNOT_RESOLVE_SDK_TYPE("cannot resolve SDK type %s"),
56 // TODO(zundel): error message needs JUnit test 51 // TODO(zundel): error message needs JUnit test
57 CANNOT_RESOLVE_SUPER_CONSTRUCTOR("cannot resolve method '%s'"), 52 CANNOT_RESOLVE_SUPER_CONSTRUCTOR("cannot resolve method '%s'"),
58 CANNOT_RESOLVE_IMPLICIT_CALL_TO_SUPER_CONSTRUCTOR( 53 CANNOT_RESOLVE_IMPLICIT_CALL_TO_SUPER_CONSTRUCTOR(
59 "super type %s does not have a default constructor"), 54 "super type %s does not have a default constructor"),
60 // TODO(zundel): error message needs JUnit test 55 // TODO(zundel): error message needs JUnit test
61 CANNOT_USE_TYPE("Cannot reference the type '%s' in this context"), 56 CANNOT_USE_TYPE("Cannot reference the type '%s' in this context"),
62 // TODO(zundel): error message needs JUnit test 57 // TODO(zundel): error message needs JUnit test
63 CANNOT_USE_TYPE_VARIABLE("Cannot reference the type variable '%s' in this cont ext"), 58 CANNOT_USE_TYPE_VARIABLE("Cannot reference the type variable '%s' in this cont ext"),
64 CIRCULAR_REFERENCE( 59 CIRCULAR_REFERENCE(
65 "Circular reference detected: compile-time constants cannot reference the mselves."), 60 "Circular reference detected: compile-time constants cannot reference the mselves."),
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 @Override 266 @Override
272 public SubSystem getSubSystem() { 267 public SubSystem getSubSystem() {
273 return SubSystem.RESOLVER; 268 return SubSystem.RESOLVER;
274 } 269 }
275 270
276 @Override 271 @Override
277 public boolean needsRecompilation() { 272 public boolean needsRecompilation() {
278 return true; 273 return true;
279 } 274 }
280 } 275 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698