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

Unified Diff: compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java

Issue 10735039: Issue 3986. Class member cannot have the same name as the class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java b/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
index 9178eb0ff7bfef06148e20197a951f1070b11f2e..836e1d0865812b550227d7ef37a0d2a6e787811f 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
@@ -1309,6 +1309,28 @@ public class NegativeResolverTest extends CompilerTestCase {
Type boundType = typeParameter.getBound().getType();
assertEquals("A", boundType.getElement().getName());
}
+
+ /**
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=3986
+ */
+ public void test_memberWithNameOfClass() throws Exception {
Brian Wilkerson 2012/07/11 14:54:15 Consider adding tests for static members. Also, th
+ checkSourceErrors(
+ makeCode(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " A() {}",
+ "}",
+ "class B {",
+ " var B;",
+ "}",
+ "class C {",
+ " void C() {}",
+ "}",
+ ""),
+ errEx(ResolverErrorCode.MEMBER_WITH_NAME_OF_CLASS, 6, 7, 1),
+ errEx(ResolverErrorCode.CONSTRUCTOR_CANNOT_HAVE_RETURN_TYPE, 9, 3, 4));
+ }
public void test_methodCannotBeResolved() throws Exception {
checkSourceErrors(

Powered by Google App Engine
This is Rietveld 408576698