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

Unified Diff: pkg/analyzer/test/generated/static_type_warning_code_test.dart

Issue 757023004: Fix issue 21426 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/static_type_warning_code_test.dart
diff --git a/pkg/analyzer/test/generated/static_type_warning_code_test.dart b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
index fd2950314b00b3009c7045eeac23f91585374667..fa0c16e73e82fb7f82058251a8e587de60ce9058 100644
--- a/pkg/analyzer/test/generated/static_type_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
@@ -1189,6 +1189,78 @@ f(T e) { return e.m; }''');
assertErrors(source, [StaticTypeWarningCode.UNDEFINED_GETTER]);
}
+ void test_undefinedSuperGetter() {
+ Source source = addSource(r'''
+class A {}
+class B extends A {
+ get g {
+ return super.g;
+ }
+}''');
+ resolve(source);
+ assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SUPER_GETTER]);
+ }
+
+ void test_undefinedSuperOperator_binaryExpression() {
+ Source source = addSource(r'''
+class A {}
+class B extends A {
+ operator +(value) {
+ return super + value;
+ }
+}''');
+ resolve(source);
+ assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR]);
+ }
+
+ void test_undefinedSuperOperator_indexBoth() {
+ Source source = addSource(r'''
+class A {}
+class B extends A {
+ operator [](index) {
+ return super[index]++;
+ }
+}''');
+ resolve(source);
+ assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR]);
+ }
+
+ void test_undefinedSuperOperator_indexSetter() {
+ Source source = addSource(r'''
+class A {}
+class B extends A {
+ operator []=(index, value) {
+ return super[index] = 0;
+ }
+}''');
+ resolve(source);
+ assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR]);
+ }
+
+ void test_undefinedSuperOperator_indexGetter() {
+ Source source = addSource(r'''
+class A {}
+class B extends A {
+ operator [](index) {
+ return super[index + 1];
+ }
+}''');
+ resolve(source);
+ assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR]);
+ }
+
+ void test_undefinedSuperSetter() {
+ Source source = addSource(r'''
+class A {}
+class B extends A {
+ f() {
+ super.m = 0;
+ }
+}''');
+ resolve(source);
+ assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SUPER_SETTER]);
+ }
+
void test_undefinedGetter_proxy_annotation_fakeProxy() {
Source source = addSource(r'''
library L;
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698