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

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

Issue 8728001: Support for 'abstract' modifier for class and spec recommended warnings, issue 375 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. Warning for factory constructor of abstract class. Created 9 years 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/type/TypeAnalyzerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
index 7c24236b43bea74fcb276048aef84facd949aa8e..e422b8ae8f458da39888d16f29e6c0ffa2d52440 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
@@ -366,7 +366,7 @@ public class TypeAnalyzerTest extends TypeAnalyzerTestCase {
analyzeIn(element, "fieldInInterface.noSuchField", 1);
analyzeIn(element, "staticFieldInInterface.noSuchField", 1);
- analyzeIn(element, "new ClassWithSupertypes()", 2); // Abstract class.
+ analyzeIn(element, "new ClassWithSupertypes()", 1); // Abstract class.
analyzeIn(element, "field = new ClassWithSupertypes().field", 1);
analyzeIn(element, "field = new ClassWithSupertypes().staticField", 2);
analyzeIn(element, "field = new ClassWithSupertypes().fieldInSuperclass", 1);
@@ -584,12 +584,12 @@ public class TypeAnalyzerTest extends TypeAnalyzerTestCase {
" void bar();",
"}",
// Abstract class not reported until first instantiation.
- "class Class implements Interface {",
+ "class Class implements Interface {", // ABSTRACT_CLASS_WITHOUT_ABSTRACT_MODIFIER
" Class() {}",
" String bar() { return null; }",
"}",
// Abstract class not reported until first instantiation.
- "class SubClass extends Class {",
+ "class SubClass extends Class {", // ABSTRACT_CLASS_WITHOUT_ABSTRACT_MODIFIER
" SubClass() : super() {}",
" Object bar() { return null; }",
"}",
@@ -599,20 +599,12 @@ public class TypeAnalyzerTest extends TypeAnalyzerTestCase {
"}",
"class Usage {",
" m() {",
- " new Class();", // CANNOT_INSTATIATE_ABSTRACT_CLASS
- // ABSTRACT_CLASS.
- " new Class();", // CANNOT_INSTATIATE_ABSTRACT_CLASS.
- " new SubClass();", // CANNOT_INSTATIATE_ABSTRACT_CLASS
- //ABSTRACT_CLASS.
" }",
"}"),
+ TypeErrorCode.ABSTRACT_CLASS_WITHOUT_ABSTRACT_MODIFIER,
+ TypeErrorCode.ABSTRACT_CLASS_WITHOUT_ABSTRACT_MODIFIER,
TypeErrorCode.CANNOT_OVERRIDE_METHOD_NOT_SUBTYPE,
- TypeErrorCode.CANNOT_OVERRIDE_METHOD_NOT_SUBTYPE,
- TypeErrorCode.CANNOT_INSTATIATE_ABSTRACT_CLASS,
- TypeErrorCode.ABSTRACT_CLASS,
- TypeErrorCode.CANNOT_INSTATIATE_ABSTRACT_CLASS,
- TypeErrorCode.CANNOT_INSTATIATE_ABSTRACT_CLASS,
- TypeErrorCode.ABSTRACT_CLASS);
+ TypeErrorCode.CANNOT_OVERRIDE_METHOD_NOT_SUBTYPE);
}
public void testImplementsAndOverrides2() {

Powered by Google App Engine
This is Rietveld 408576698