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

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

Issue 10106016: Remove warning for using a factory constructor on an abstract class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: # Created 8 years, 8 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/type/TypeAnalyzerCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index c2461b72cc58eb897b0b010b845ca803c835189c..7b4860b0abbfb00326664250df27d471f1284454 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -3,9 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
package com.google.dart.compiler.type;
-import static com.google.dart.compiler.common.ErrorExpectation.assertErrors;
-import static com.google.dart.compiler.common.ErrorExpectation.errEx;
-
import com.google.common.base.Joiner;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
@@ -42,6 +39,9 @@ import com.google.dart.compiler.resolver.NodeElement;
import com.google.dart.compiler.resolver.ResolverErrorCode;
import com.google.dart.compiler.resolver.TypeErrorCode;
+import static com.google.dart.compiler.common.ErrorExpectation.assertErrors;
+import static com.google.dart.compiler.common.ErrorExpectation.errEx;
+
import java.io.Reader;
import java.io.StringReader;
import java.net.URI;
@@ -116,7 +116,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
MethodElement methodElement = (MethodElement) functionElement.getEnclosingElement();
assertNotNull(methodElement);
assertSame(ElementKind.METHOD, methodElement.getKind());
- assertEquals("foo", ((MethodElement) methodElement).getName());
+ assertEquals("foo", methodElement.getName());
// use EnclosingElement methods implementations in MethodElement
assertEquals(false, methodElement.isInterface());
assertEquals(true, Iterables.isEmpty(methodElement.getMembers()));
@@ -419,7 +419,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
* Factory constructor can instantiate any class and return it non-abstract class instance, but
* spec requires warnings, so we provide it, but using different constant.
*/
- public void test_warnAbstract_onAbstractClass_whenInstantiate_factoryConstructor()
+ public void test_abstractClass_whenInstantiate_factoryConstructor()
throws Exception {
AnalyzeLibraryResult libraryResult =
analyzeLibrary(
@@ -436,8 +436,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
" }",
"}"));
assertErrors(
- libraryResult.getTypeErrors(),
- errEx(TypeErrorCode.INSTANTIATION_OF_ABSTRACT_CLASS_USING_FACTORY, 8, 16, 1));
+ libraryResult.getTypeErrors());
}
/**
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | tests/language/src/AbstractFactoryConstructorTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698