| 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 1f9124c7c6d74e2b8743767c2231d9392e9da4e8..35cda0e7ae6b7ccdd29f6d9bee75e6f2de8d9a20 100644
|
| --- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| +++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| @@ -180,7 +180,6 @@ public class TypeAnalyzer implements DartCompilationPhase {
|
| private final Type nullType;
|
| private final InterfaceType functionType;
|
| private final InterfaceType dynamicIteratorType;
|
| - private final InterfaceType typeType;
|
| private final boolean developerModeChecks;
|
| private final boolean suppressSdkWarnings;
|
| private final boolean typeChecksForInferredTypes;
|
| @@ -215,7 +214,6 @@ public class TypeAnalyzer implements DartCompilationPhase {
|
| this.nullType = typeProvider.getNullType();
|
| this.functionType = typeProvider.getFunctionType();
|
| this.dynamicIteratorType = typeProvider.getIteratorType(dynamicType);
|
| - this.typeType = typeProvider.getTypeType();
|
| CompilerOptions compilerOptions = context.getCompilerConfiguration().getCompilerOptions();
|
| this.suppressSdkWarnings = compilerOptions.suppressSdkWarnings();
|
| this.typeChecksForInferredTypes = compilerOptions.typeChecksForInferredTypes();
|
| @@ -1853,8 +1851,8 @@ public class TypeAnalyzer implements DartCompilationPhase {
|
| }
|
| }
|
|
|
| - // no type arguments, try to infer
|
| - if (node.getTypeArguments().isEmpty()) {
|
| + // infer type of constant literal
|
| + if (node.isConst() && node.getTypeArguments().isEmpty()) {
|
| List<Type> valueTypes = Lists.newArrayList();
|
| for (DartMapLiteralEntry literalEntry : node.getEntries()) {
|
| DartExpression value = literalEntry.getValue();
|
| @@ -2707,8 +2705,8 @@ public class TypeAnalyzer implements DartCompilationPhase {
|
| }
|
| }
|
| }
|
| - // no type arguments, try to infer
|
| - if (node.getTypeArguments().isEmpty()) {
|
| + // infer type of constant literal
|
| + if (node.isConst() && node.getTypeArguments().isEmpty()) {
|
| List<Type> elementTypes = Lists.newArrayList();
|
| for (DartExpression expression : node.getExpressions()) {
|
| Type elementType = expression.getType();
|
|
|