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

Unified Diff: tests/compiler/dart2js/resolver_test.dart

Issue 1090923004: Make super.foo= erroneous if they are not assignable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
« no previous file with comments | « pkg/compiler/lib/src/warnings.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/resolver_test.dart
diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart
index db14e8692642c2d98ac6b49cac5adad3061d0bf0..d64cacfc1b6b0b02380fb8c8cce6f740bb3b7b13 100644
--- a/tests/compiler/dart2js/resolver_test.dart
+++ b/tests/compiler/dart2js/resolver_test.dart
@@ -1177,6 +1177,15 @@ testCantAssignMethods() {
}
}
''', [MessageKind.SETTER_NOT_FOUND]);
+ checkWarningOn('''
+ main() { new B().bar(); }
+ class B {
+ mname() {}
+ bar() {
+ this.mname = () => null;
+ }
+ }
+ ''', [MessageKind.SETTER_NOT_FOUND]);
// Can't override super methods
checkWarningOn('''
@@ -1189,7 +1198,7 @@ testCantAssignMethods() {
super.mname = () => 6;
}
}
- ''', [MessageKind.SETTER_NOT_FOUND]);
+ ''', [MessageKind.ASSIGNING_METHOD_IN_SUPER]);
// But index operators should be OK
checkWarningOn('''
@@ -1247,6 +1256,15 @@ testCantAssignFinalAndConsts() {
}
''', [MessageKind.SETTER_NOT_FOUND]);
+ // ... even if 'this' is explicit:
+ checkWarningOn('''
+ main() => new B().m();
+ class B {
+ final x = 1;
+ m() { this.x = 2; }
+ }
+ ''', [MessageKind.SETTER_NOT_FOUND]);
+
// ... and in super class:
checkWarningOn('''
main() => new B().m();
@@ -1256,7 +1274,7 @@ testCantAssignFinalAndConsts() {
class B extends A {
m() { super.x = 2; }
}
- ''', [MessageKind.SETTER_NOT_FOUND]);
+ ''', [MessageKind.SETTER_NOT_FOUND_IN_SUPER]);
// But non-final fields are OK:
checkWarningOn('''
« no previous file with comments | « pkg/compiler/lib/src/warnings.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698