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

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/tree/nodes.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..f649d3257425167db5f806039e91540aa25951d4 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -3012,27 +3012,29 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
MessageKind.ASSIGNING_TYPE, const {});
registry.registerThrowNoSuchMethod();
} else if (target.isFinal || target.isConst) {
- if (Elements.isStaticOrTopLevelField(target) || target.isLocal) {
+ if (Elements.isStaticOrTopLevelField(target) || target.isLocal ||
+ node.isSuperCall || node.isThisCall) {
Johnni Winther 2015/04/17 12:17:37 Remove `node.isThisCall`. It is not a statically k
Siggi Cherem (dart-lang) 2015/04/17 16:38:24 Good call. Done.
setter = reportAndCreateErroneousElement(
node.selector, target.name, MessageKind.CANNOT_RESOLVE_SETTER,
const {});
} 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.
+ // For implicit 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();
Johnni Winther 2015/04/17 12:17:37 I would special case super calls here, creating an
Siggi Cherem (dart-lang) 2015/04/17 16:38:24 Not sure I completely followed - when you say a sp
Johnni Winther 2015/04/17 17:56:09 'method' -> 'message' !
} else if (target.isFunction && target.name != '[]=') {
assert(!target.isSetter);
- if (Elements.isStaticOrTopLevelFunction(target) || target.isLocal) {
+ if (Elements.isStaticOrTopLevelFunction(target) || target.isLocal ||
+ node.isSuperCall || node.isThisCall) {
Johnni Winther 2015/04/17 12:17:37 Similarly regarding `node.isThisCall`. The class c
Siggi Cherem (dart-lang) 2015/04/17 16:38:23 Done.
setter = reportAndCreateErroneousElement(
node.selector, target.name, MessageKind.ASSIGNING_METHOD,
const {});
} 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.
+ // For implicit 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();
Johnni Winther 2015/04/17 12:17:37 I would special case super calls here, creating an
Siggi Cherem (dart-lang) 2015/04/17 16:38:24 Done.
« no previous file with comments | « no previous file | pkg/compiler/lib/src/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698