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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 12326041: Make an erroneous element when setting a final field. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of resolution; 5 part of resolution;
6 6
7 abstract class TreeElements { 7 abstract class TreeElements {
8 Element operator[](Node node); 8 Element operator[](Node node);
9 Selector getSelector(Send send); 9 Selector getSelector(Send send);
10 DartType getType(Node node); 10 DartType getType(Node node);
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 compiler.backend.registerThrowNoSuchMethod(); 2222 compiler.backend.registerThrowNoSuchMethod();
2223 } 2223 }
2224 if (isComplex && getter == null && !inInstanceContext) { 2224 if (isComplex && getter == null && !inInstanceContext) {
2225 getter = 2225 getter =
2226 warnAndCreateErroneousElement(node.selector, field.name, 2226 warnAndCreateErroneousElement(node.selector, field.name,
2227 MessageKind.CANNOT_RESOLVE_GETTER); 2227 MessageKind.CANNOT_RESOLVE_GETTER);
2228 compiler.backend.registerThrowNoSuchMethod(); 2228 compiler.backend.registerThrowNoSuchMethod();
2229 } 2229 }
2230 } else if (target.impliesType()) { 2230 } else if (target.impliesType()) {
2231 compiler.backend.registerThrowNoSuchMethod(); 2231 compiler.backend.registerThrowNoSuchMethod();
2232 } else if (target.modifiers.isFinal() || target.modifiers.isConst()) {
2233 setter =
2234 warnAndCreateErroneousElement(node.selector, target.name,
2235 MessageKind.CANNOT_RESOLVE_SETTER);
2236 compiler.backend.registerThrowNoSuchMethod();
2232 } 2237 }
2233 } 2238 }
2234 2239
2235 visit(node.argumentsNode); 2240 visit(node.argumentsNode);
2236 2241
2237 // TODO(ngeoffray): Check if the target can be assigned. 2242 // TODO(ngeoffray): Check if the target can be assigned.
2238 // TODO(ngeoffray): Warn if target is null and the send is 2243 // TODO(ngeoffray): Warn if target is null and the send is
2239 // unqualified. 2244 // unqualified.
2240 2245
2241 Selector selector = mapping.getSelector(node); 2246 Selector selector = mapping.getSelector(node);
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
3728 return e; 3733 return e;
3729 } 3734 }
3730 3735
3731 /// Assumed to be called by [resolveRedirectingFactory]. 3736 /// Assumed to be called by [resolveRedirectingFactory].
3732 Element visitReturn(Return node) { 3737 Element visitReturn(Return node) {
3733 Node expression = node.expression; 3738 Node expression = node.expression;
3734 return finishConstructorReference(visit(expression), 3739 return finishConstructorReference(visit(expression),
3735 expression, expression); 3740 expression, expression);
3736 } 3741 }
3737 } 3742 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698