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 9e78372180f002865b70903e0c4312a8f01dcea6..f7b32a95af9d7a4439a834a0bf6aa89b3bbfa055 100644 |
| --- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java |
| +++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java |
| @@ -2923,6 +2923,34 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase { |
| libraryResult.getErrors(), |
| errEx(TypeErrorCode.NOT_A_TYPE, 3, 1, 4)); |
| } |
| + |
| + public void test_metadata_deprecated() throws Exception { |
| + AnalyzeLibraryResult libraryResult = analyzeLibrary( |
| + "// filler filler filler filler filler filler filler filler filler filler", |
| + "// @deprecated", |
| + "ttt() {}", |
| + "// @deprecated", |
|
Brian Wilkerson
2012/06/29 16:17:49
Does deprecating a class implicitly deprecate ever
scheglov
2012/06/29 20:11:57
Constructor invocation has form: Type[.nameOfConst
Brian Wilkerson
2012/06/29 20:20:28
OK. I understand the reasoning behind the behavior
|
| + "class A {", |
| + " // @deprecated", |
| + " var fff;", |
| + " // @deprecated", |
| + " mmm() {}", |
| + "}", |
| + "main() {", |
| + " ttt();", |
| + " A a = new A();", |
| + " a.fff = 0;", |
| + " a.mmm();", |
| + "}", |
| + ""); |
| + assertErrors( |
| + libraryResult.getErrors(), |
| + errEx(TypeErrorCode.DEPRECATED_ELEMENT, 13, 3, 1), |
| + errEx(TypeErrorCode.DEPRECATED_ELEMENT, 13, 13, 1), |
| + errEx(TypeErrorCode.DEPRECATED_ELEMENT, 12, 3, 3), |
| + errEx(TypeErrorCode.DEPRECATED_ELEMENT, 14, 5, 3), |
| + errEx(TypeErrorCode.DEPRECATED_ELEMENT, 15, 5, 3)); |
| + } |
| private static <T extends DartNode> T findNode( |
| AnalyzeLibraryResult libraryResult, |