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

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

Issue 10661022: Issue 3752. Support for @override annotations (as structured doc comments) (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 00ad1532e4e2965e4305b3062460ae530628f81f..e8ee97596ee77b926f4cb247601047494fa036b2 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -1492,6 +1492,35 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
result.getErrors(),
errEx(ResolverErrorCode.CANNOT_OVERRIDE_METHOD_NAMED_PARAMS, 5, 3, 3));
}
+
+ public void test_metadataOverride_OK_method() throws Exception {
+ AnalyzeLibraryResult result = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " foo() {}",
+ "}",
+ "class B extends A {",
+ " // @override",
+ " foo() {}",
+ "}",
+ "");
+ assertErrors(result.getErrors());
+ }
+
+ public void test_metadataOverride_Bad_method() throws Exception {
+ AnalyzeLibraryResult result = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ "}",
+ "class B extends A {",
+ " // @override",
+ " foo() {}",
+ "}",
+ "");
+ assertErrors(
+ result.getErrors(),
+ errEx(ResolverErrorCode.INVALID_OVERRIDE_METADATA, 6, 3, 3));
+ }
/**
* It is a compile-time error if an instance method m1 overrides an instance member m2 and m1 does

Powered by Google App Engine
This is Rietveld 408576698