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

Unified Diff: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java

Issue 9479013: Remove backends. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More clean up Created 8 years, 10 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/type/TypeAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
index 04d2b458412adf1a5743e3a2fd53112a240664d9..f6e07427c9ae98dbc4c1044e32023efb9679b6fa 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -192,7 +192,6 @@ public class TypeAnalyzer implements DartCompilationPhase {
private final Type nullType;
private final InterfaceType functionType;
private final InterfaceType dynamicIteratorType;
- private final boolean developerModeChecks;
/**
* Keeps track of the number of nested catches, used to detect re-throws
@@ -204,7 +203,6 @@ public class TypeAnalyzer implements DartCompilationPhase {
ConcurrentHashMap<ClassElement, List<Element>> unimplementedElements,
Set<ClassElement> diagnosedAbstractClasses) {
this.context = context;
- this.developerModeChecks = context.getCompilerConfiguration().developerModeChecks();
this.unimplementedElements = unimplementedElements;
this.types = Types.getInstance(typeProvider);
this.dynamicType = typeProvider.getDynamicType();
@@ -1119,10 +1117,9 @@ public class TypeAnalyzer implements DartCompilationPhase {
// Check the map literal entries against the return type.
Type valueType = type.getArguments().get(1);
for (DartMapLiteralEntry literalEntry : node.getEntries()) {
- boolean result = checkAssignable(literalEntry, typeOf(literalEntry), valueType);
- if (developerModeChecks == true && result == false) {
- typeError(literalEntry, ResolverErrorCode.MAP_LITERAL_ELEMENT_TYPE,
- valueType.toString());
+ boolean isValueAssignable = checkAssignable(literalEntry, typeOf(literalEntry), valueType);
+ if (!isValueAssignable) {
zundel 2012/02/29 22:51:59 developer mode checks are important here, because
scheglov 2012/02/29 23:14:55 Should I just change this to be an type warning?
zundel 2012/02/29 23:24:51 No, it is a compile-time error if developer mode i
scheglov 2012/02/29 23:46:59 OK, restored.
+ typeError(literalEntry, ResolverErrorCode.MAP_LITERAL_ELEMENT_TYPE, valueType);
}
}
@@ -1716,10 +1713,9 @@ public class TypeAnalyzer implements DartCompilationPhase {
InterfaceType type = node.getType();
Type elementType = type.getArguments().get(0);
for (DartExpression expression : node.getExpressions()) {
- boolean result = checkAssignable(elementType, expression);
- if (developerModeChecks == true && result == false) {
- typeError(expression, ResolverErrorCode.LIST_LITERAL_ELEMENT_TYPE,
- elementType.toString());
+ boolean isValueAssignable = checkAssignable(elementType, expression);
+ if (!isValueAssignable) {
+ typeError(expression, ResolverErrorCode.LIST_LITERAL_ELEMENT_TYPE, elementType);
}
}
return type;

Powered by Google App Engine
This is Rietveld 408576698