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 2eddbd02b19b6390df6085a5e5007b60de67ea8b..64ef5cb6e63f4057b7a2af29d18636a2512a2478 100644 |
| --- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java |
| +++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java |
| @@ -421,4 +421,26 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase { |
| libraryResult.getTypeErrors(), |
| errEx(TypeErrorCode.INSTANTIATION_OF_ABSTRACT_CLASS_USING_FACTORY, 8, 16, 1)); |
| } |
| + |
| + /** |
| + * 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. |
|
scheglov
2012/01/11 18:15:08
Comment does not correspond to the method.
codefu
2012/01/11 18:16:08
Copy and paste error on my part. Will update in a
|
| + */ |
| + public void testWarnOnNonVoidSetter() |
| + throws Exception { |
| + AnalyzeLibraryResult libraryResult = |
| + analyzeLibrary( |
| + getName(), |
| + makeCode( |
| + "class A {", |
| + " void set foo(bool a) {}", |
| + " set bar(bool a) {}", |
| + " Dynamic set baz(bool a) {}", |
| + " bool set bob(bool a) {}", |
| + "}")); |
| + assertErrors( |
| + libraryResult.getTypeErrors(), |
| + errEx(TypeErrorCode.SETTER_RETURN_TYPE, 4, 3, 7), |
| + errEx(TypeErrorCode.SETTER_RETURN_TYPE, 5, 3, 4)); |
| + } |
| } |