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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java

Issue 8351013: Correct method override checks to conform to the spec.wq (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 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
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/Types.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
===================================================================
--- compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java (revision 638)
+++ compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java (working copy)
@@ -751,7 +751,7 @@
DartCompilerErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
analyzeFail("for (;'';) {}",
DartCompilerErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
-
+
// Foreach tests
analyze("{ List<String> strings = ['1','2','3']; for (String s in strings) {} }");
analyzeFail("{ List<int> ints = [1,2,3]; for (String s in ints) {} }",
@@ -780,7 +780,7 @@
"}");
analyzeClasses(fieldNotMethod, DartCompilerErrorCode.FOR_IN_WITH_ITERATOR_FIELD);
}
-
+
public void testForEachStatement_Negative2() {
Map<String, ClassElement> invalidReturnType = loadSource(
"class A {",
@@ -1309,7 +1309,7 @@
public void testImplementsAndOverrides() {
analyzeClasses(loadSource(
"interface Interface {",
- " void foo();",
+ " void foo([x = null]);",
" void bar();",
"}",
// Abstract class not reported until first instantiation.
@@ -1324,7 +1324,7 @@
"}",
"class SubSubClass extends Class {",
" num bar() { return null; }", // TYPE_NOT_ASSIGNMENT_COMPATIBLE.
- " void foo([x = null]) {}", // TYPE_NOT_ASSIGNMENT_COMPATIBLE.
+ " void foo() {}", // TYPE_NOT_ASSIGNMENT_COMPATIBLE.
"}",
"class Usage {",
" m() {",
@@ -1344,6 +1344,19 @@
DartCompilerErrorCode.ABSTRACT_CLASS);
}
+ public void testImplementsAndOverrides2() {
+ analyzeClasses(loadSource(
+ "interface Interface {",
+ " void foo([x = null]);",
+ "}",
+ // Abstract class not reported until first instantiation.
+ "class Class implements Interface {",
+ " Class() {}",
+ " void foo() {}", // TYPE_NOT_ASSIGNMENT_COMPATIBLE.
+ "}"),
+ DartCompilerErrorCode.CANNOT_OVERRIDE_TYPED_MEMBER);
+ }
+
public void testOddStuff() {
Map<String, ClassElement> classes = analyzeClasses(loadSource(
"class Class {",
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/Types.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698