Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java |
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java |
index a3665af11e7c648b6da709a81b4f34bde7772eeb..9e78372180f002865b70903e0c4312a8f01dcea6 100644 |
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java |
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java |
@@ -1489,7 +1489,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase { |
result.getErrors(), |
errEx(ResolverErrorCode.CANNOT_OVERRIDE_METHOD_NAMED_PARAMS, 5, 3, 3)); |
} |
- |
+ |
public void test_metadataOverride_OK_method() throws Exception { |
AnalyzeLibraryResult result = analyzeLibrary( |
"// filler filler filler filler filler filler filler filler filler filler", |
@@ -1503,7 +1503,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase { |
""); |
assertErrors(result.getErrors()); |
} |
- |
+ |
public void test_metadataOverride_Bad_method() throws Exception { |
AnalyzeLibraryResult result = analyzeLibrary( |
"// filler filler filler filler filler filler filler filler filler filler", |
@@ -1576,7 +1576,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase { |
errEx(ResolverErrorCode.FIELD_GETTER_SETTER_SAME_STATIC, 4, 14, 5), |
errEx(ResolverErrorCode.FIELD_GETTER_SETTER_SAME_STATIC, 8, 14, 5)); |
} |
- |
+ |
/** |
* <p> |
* http://code.google.com/p/dart/issues/detail?id=380 |
@@ -2914,6 +2914,16 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase { |
errEx(TypeErrorCode.INCOMPATIBLE_TYPES_IN_HIERARCHY, 7, 7, 1)); |
} |
+ public void test_variableUsedAsType() throws Exception { |
+ AnalyzeLibraryResult libraryResult = analyzeLibrary( |
+ "// filler filler filler filler filler filler filler filler filler filler", |
+ "var func;", |
+ "func i;"); |
+ assertErrors( |
+ libraryResult.getErrors(), |
+ errEx(TypeErrorCode.NOT_A_TYPE, 3, 1, 4)); |
+ } |
+ |
private static <T extends DartNode> T findNode( |
AnalyzeLibraryResult libraryResult, |
final Class<T> clazz, |