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

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

Issue 10870089: Issue 4681. Resolve @metadata for all possible targets (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 d2c58b6599818fe4c82352101b01348c9c51faa9..ae6920d06371cf21e2a4e425e252bceffb2cd283 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -1558,7 +1558,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
errEx(ResolverErrorCode.CANNOT_OVERRIDE_METHOD_NAMED_PARAMS, 5, 3, 3));
}
- public void test_metadataOverride_OK_method() throws Exception {
+ public void test_metadataCommentOverride_OK_method() throws Exception {
AnalyzeLibraryResult result = analyzeLibrary(
"// filler filler filler filler filler filler filler filler filler filler",
"class A {",
@@ -1572,7 +1572,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
assertErrors(result.getErrors());
}
- public void test_metadataOverride_Bad_method() throws Exception {
+ public void test_metadataCommentOverride_Bad_method() throws Exception {
AnalyzeLibraryResult result = analyzeLibrary(
"// filler filler filler filler filler filler filler filler filler filler",
"class A {",
@@ -3366,7 +3366,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
errEx(TypeErrorCode.NOT_A_TYPE, 3, 1, 4));
}
- public void test_metadata_deprecated_1() throws Exception {
+ public void test_metadataComment_deprecated_1() throws Exception {
AnalyzeLibraryResult libraryResult = analyzeLibrary(
"// filler filler filler filler filler filler filler filler filler filler",
"// @deprecated",
@@ -3395,7 +3395,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
errEx(TypeErrorCode.DEPRECATED_ELEMENT, 17, 5, 1));
}
- public void test_metadata_deprecated_2() throws Exception {
+ public void test_metadataComment_deprecated_2() throws Exception {
AnalyzeLibraryResult libraryResult = analyzeLibrary(
"// filler filler filler filler filler filler filler filler filler filler",
"// @deprecated",
@@ -3415,6 +3415,28 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
errEx(TypeErrorCode.DEPRECATED_ELEMENT, 10, 7, 1),
errEx(TypeErrorCode.DEPRECATED_ELEMENT, 10, 9, 7));
}
+
+ public void test_metadata_resolving() throws Exception {
+ AnalyzeLibraryResult libraryResult = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "const test = 0;",
+ "",
+ "@test",
+ "class A {",
+ " @test",
+ " m(@test p) {",
+ " @test var v = 0;",
+ " }",
+ "}",
+ "",
+ "f(@test p) {}",
+ "",
+ "@test typedef F();",
+ "",
+ "");
+ // @deprecated should be resolved at every place, so no errors
+ assertErrors(libraryResult.getErrors());
+ }
public void test_assignMethod() throws Exception {
AnalyzeLibraryResult libraryResult = analyzeLibrary(

Powered by Google App Engine
This is Rietveld 408576698