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

Unified Diff: pkg/compiler/lib/src/resolution/members.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 | « no previous file | pkg/compiler/lib/src/warnings.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/members.dart
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
index 837fb401e856eac7faa3df939601f43bd8be2c8a..6eb0899741e0e7f389f945ec517ec342fadd095a 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -3016,26 +3016,35 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
setter = reportAndCreateErroneousElement(
node.selector, target.name, MessageKind.CANNOT_RESOLVE_SETTER,
const {});
+ } else if (node.isSuperCall) {
+ setter = reportAndCreateErroneousElement(
+ node.selector, target.name, MessageKind.SETTER_NOT_FOUND_IN_SUPER,
+ {'name': target.name, 'className': currentClass.name});
+ registry.registerSuperNoSuchMethod();
} else {
// For instance fields we don't report a warning here because the type
// checker will detect this as well and report a better error message
// with the context of the containing class.
}
registry.registerThrowNoSuchMethod();
- if (node.isSuperCall) registry.registerSuperNoSuchMethod();
} else if (target.isFunction && target.name != '[]=') {
assert(!target.isSetter);
if (Elements.isStaticOrTopLevelFunction(target) || target.isLocal) {
setter = reportAndCreateErroneousElement(
node.selector, target.name, MessageKind.ASSIGNING_METHOD,
const {});
+ } else if (node.isSuperCall) {
+ setter = reportAndCreateErroneousElement(
+ node.selector, target.name, MessageKind.ASSIGNING_METHOD_IN_SUPER,
+ {'name': target.name,
+ 'superclassName': target.enclosingElement.name});
+ registry.registerSuperNoSuchMethod();
} else {
// For instance methods we don't report a warning here because the
// type checker will detect this as well and report a better error
// message with the context of the containing class.
}
registry.registerThrowNoSuchMethod();
- if (node.isSuperCall) registry.registerSuperNoSuchMethod();
}
if (isPotentiallyMutableTarget(target)) {
registry.registerPotentialMutation(target, node);
« no previous file with comments | « no previous file | pkg/compiler/lib/src/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698