Chromium Code Reviews| 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 4d2dd7264ed2c4cea65757233df058954adb22e3..7458f453b85254533b70bbc4c7f5fff1c4738f23 100644 |
| --- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java |
| +++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java |
| @@ -122,24 +122,6 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase { |
| } |
| /** |
| - * Language specification requires that factory should be declared in class. However declaring |
| - * factory on top level should not cause exceptions in compiler. Even if type parameters are used. |
| - * <p> |
| - * http://code.google.com/p/dart/issues/detail?id=345 |
|
ahe
2011/12/15 09:02:13
I don't understand what is going on with this bug.
|
| - */ |
| - public void test_badTopLevelFactory_withTypeParameters() throws Exception { |
| - AnalyzeLibraryResult libraryResult = analyzeLibrary("Test.dart", "factory foo<T>() {}"); |
| - DartUnit unit = libraryResult.getLibraryUnitResult().getUnits().iterator().next(); |
| - DartMethodDefinition factory = (DartMethodDefinition) unit.getTopLevelNodes().get(0); |
| - assertNotNull(factory); |
| - // normal method requires name, so we provide some name |
| - assertEquals(true, factory.getName() instanceof DartIdentifier); |
| - assertEquals("foo<T>", ((DartIdentifier) factory.getName()).getTargetName()); |
| - // compilation error expected |
| - assertBadTopLevelFactoryError(libraryResult); |
| - } |
| - |
| - /** |
| * Asserts that given {@link AnalyzeLibraryResult} contains {@link DartCompilationError} for |
| * invalid factory on top level. |
| */ |
| @@ -205,7 +187,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase { |
| // Check type warnings. |
| { |
| List<DartCompilationError> errors = libraryResult.getTypeErrors(); |
| - assertErrors(errors, errEx(TypeErrorCode.FACTORY_CONSTRUCTOR_TYPES, 2, 3, 29)); |
| + assertErrors(errors, errEx(TypeErrorCode.DEFAULT_CONSTRUCTOR_TYPES, 2, 3, 29)); |
| assertEquals( |
| "Constructor 'I.foo' in 'I' has parameters types (int,int,int), doesn't match 'F.foo' in 'F' with (num,bool,Object)", |
| errors.get(0).getMessage()); |