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

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

Issue 10703046: Issue 3753. Support for @deprecated annotation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 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,

Powered by Google App Engine
This is Rietveld 408576698