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

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

Issue 9148026: Recompile unit with potential conflict/dependency on some top-level symbol. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix for compiling corelib, so NPE in TreeShaker Created 8 years, 11 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/resolver/TypeErrorCode.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/TypeErrorCode.java b/compiler/java/com/google/dart/compiler/resolver/TypeErrorCode.java
index 0a8c9f619455213cbac5da2c80ea1c05a331f6f0..c17bfcddce19d79372b60e08a8d59b7de663d953 100644
--- a/compiler/java/com/google/dart/compiler/resolver/TypeErrorCode.java
+++ b/compiler/java/com/google/dart/compiler/resolver/TypeErrorCode.java
@@ -13,7 +13,7 @@ import com.google.dart.compiler.SubSystem;
public enum TypeErrorCode implements ErrorCode {
ABSTRACT_CLASS_WITHOUT_ABSTRACT_MODIFIER(
"%s is an abstract class because it does not implement the inherited abstract members: %s"),
- CANNOT_BE_RESOLVED("cannot resolve %s"),
+ CANNOT_BE_RESOLVED("cannot resolve %s", true),
CANNOT_OVERRIDE_TYPED_MEMBER("cannot override %s of %s because %s is not assignable to %s"),
CANNOT_OVERRIDE_METHOD_NOT_SUBTYPE("cannot override %s of %s because %s is not a subtype of %s"),
DEFAULT_CONSTRUCTOR_TYPES(
@@ -27,17 +27,17 @@ public enum TypeErrorCode implements ErrorCode {
INSTANTIATION_OF_CLASS_WITH_UNIMPLEMENTED_MEMBERS(
"instantiation of class %s with the inherited abstract members: %s"),
INTERFACE_HAS_NO_METHOD_NAMED("%s has no method named \"%s\""),
- INTERNAL_ERROR("internal error: %s"),
+ INTERNAL_ERROR("internal error: %s", true),
IS_STATIC_FIELD_IN("\"%s\" is a static field in \"%s\""),
IS_STATIC_METHOD_IN("\"%s\" is a static method in \"%s\""),
MEMBER_IS_A_CONSTRUCTOR("%s is a constructor in %s"),
MISSING_ARGUMENT("missing argument of type %s"),
MISSING_RETURN_VALUE("no return value; expected a value of type %s"),
- NO_SUCH_TYPE("no such type \"%s\""),
+ NO_SUCH_TYPE("no such type \"%s\"", true),
NOT_A_FUNCTION("\"%s\" is not a function"),
NOT_A_MEMBER_OF("\"%s\" is not a member of %s"),
NOT_A_METHOD_IN("\"%s\" is not a method in %s"),
- NOT_A_TYPE("type \"%s\" expected, but \"%s\" found"),
+ NOT_A_TYPE("type \"%s\" expected, but \"%s\" found", true),
OPERATOR_WRONG_OPERAND_TYPE("operand of \"%s\" must be assignable to \"%s\""),
SETTER_RETURN_TYPE("Specified return type of setter '%s' is non-void"),
STATIC_MEMBER_ACCESSED_THROUGH_INSTANCE(
@@ -48,22 +48,22 @@ public enum TypeErrorCode implements ErrorCode {
USE_ASSIGNMENT_ON_SETTER("Use assignment to set field \"%s\" in %s"),
VOID("expression does not yield a value"),
WRONG_NUMBER_OF_TYPE_ARGUMENTS("%s: wrong number of type arguments, Expected %d");
- private final ErrorSeverity severity;
private final String message;
+ private final boolean needsRecompilation;
/**
- * Initialize a newly created error code to have the given message and WARNING severity.
+ * Initialize a newly created error code to have the given message.
*/
private TypeErrorCode(String message) {
- this(ErrorSeverity.WARNING, message);
+ this(message, false);
}
/**
- * Initialize a newly created error code to have the given severity and message.
+ * Initialize a newly created error code to have the given message and compilation flag.
*/
- private TypeErrorCode(ErrorSeverity severity, String message) {
- this.severity = severity;
+ private TypeErrorCode(String message, boolean needsRecompilation) {
this.message = message;
+ this.needsRecompilation = needsRecompilation;
}
@Override
@@ -73,11 +73,16 @@ public enum TypeErrorCode implements ErrorCode {
@Override
public ErrorSeverity getErrorSeverity() {
- return severity;
+ return ErrorSeverity.WARNING;
}
@Override
public SubSystem getSubSystem() {
return SubSystem.STATIC_TYPE;
}
+
+ @Override
+ public boolean needsRecompilation() {
+ return this.needsRecompilation;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698