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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java

Issue 25505006: Report BUILT_IN_IDENTIFIER_AS_TYPE for formal parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Report BUILT_IN_IDENTIFIER_AS_TYPE in type resolver. Created 7 years, 2 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: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
index d604698bbc2ebd89e8661536777122881fadabbe..79b11be0a9e43703497a6db482bc4d0088cf6906 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
@@ -147,16 +147,33 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void test_builtInIdentifierAsType() throws Exception {
+ public void test_builtInIdentifierAsType_formalParameter_field() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " var x;",
+ " A(static this.x);",
+ "}"));
+ resolve(source);
+ assertErrors(source, CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE);
+ verify(source);
+ }
+
+ public void test_builtInIdentifierAsType_formalParameter_simple() throws Exception {
+ Source source = addSource(createSource(//
+ "f(static x) {",
+ "}"));
+ resolve(source);
+ assertErrors(source, CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE);
+ verify(source);
+ }
+
+ public void test_builtInIdentifierAsType_variableDeclaration() throws Exception {
Source source = addSource(createSource(//
"f() {",
" typedef x;",
"}"));
resolve(source);
- assertErrors(
- source,
- CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE,
- StaticWarningCode.UNDEFINED_CLASS);
+ assertErrors(source, CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE);
verify(source);
}

Powered by Google App Engine
This is Rietveld 408576698