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

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

Issue 27055004: Issue 13703. Report CONFLICTING_TYPE_VARIABLE_AND_CLASS and CONFLICTING_TYPE_VARIABLE_AND_MEMBER. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 f1a3e65e2630c4e74376e5930d99a6e73bac65c2..3df7506c6f4c054f8ce949fc1aeb932f457fe099 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
@@ -307,6 +307,65 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_conflictingTypeVariableAndClass() throws Exception {
+ Source source = addSource(createSource(//
+ "class T<T> {",
+ "}"));
+ resolve(source);
+ assertErrors(source, CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLASS);
+ verify(source);
+ }
+
+ public void test_conflictingTypeVariableAndMember_field() throws Exception {
+ Source source = addSource(createSource(//
+ "class A<T> {",
+ " var T;",
+ "}"));
+ resolve(source);
+ assertErrors(source, CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER);
+ verify(source);
+ }
+
+ public void test_conflictingTypeVariableAndMember_getter() throws Exception {
+ Source source = addSource(createSource(//
+ "class A<T> {",
+ " get T => null;",
+ "}"));
+ resolve(source);
+ assertErrors(source, CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER);
+ verify(source);
+ }
+
+ public void test_conflictingTypeVariableAndMember_method() throws Exception {
+ Source source = addSource(createSource(//
+ "class A<T> {",
+ " T() {}",
+ "}"));
+ resolve(source);
+ assertErrors(source, CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER);
+ verify(source);
+ }
+
+ public void test_conflictingTypeVariableAndMember_method_static() throws Exception {
+ Source source = addSource(createSource(//
+ "class A<T> {",
+ " static T() {}",
+ "}"));
+ resolve(source);
+ assertErrors(source, CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER);
+ verify(source);
+ }
+
+ public void test_conflictingTypeVariableAndMember_setter() throws Exception {
+ Source source = addSource(createSource(//
+ "class A<T> {",
+ " set T(x) {}",
+ "}"));
+ resolve(source);
+ assertErrors(source, CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER);
+ verify(source);
+ }
+
public void test_constConstructorWithNonConstSuper_explicit() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698