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

Side by Side Diff: pkg/compiler/lib/src/resolution/members.dart

Issue 1073983003: Make invalid to override method names for local nested functions (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/compiler/dart2js/resolver_test.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 AnalyzableElement get analyzedElement; 8 AnalyzableElement get analyzedElement;
9 Iterable<Node> get superUses; 9 Iterable<Node> get superUses;
10 10
(...skipping 2976 matching lines...) Expand 10 before | Expand all | Expand 10 after
2987 } 2987 }
2988 if (isComplex && getter == null && !inInstanceContext) { 2988 if (isComplex && getter == null && !inInstanceContext) {
2989 getter = warnAndCreateErroneousElement( 2989 getter = warnAndCreateErroneousElement(
2990 node.selector, field.name, MessageKind.CANNOT_RESOLVE_GETTER); 2990 node.selector, field.name, MessageKind.CANNOT_RESOLVE_GETTER);
2991 registry.registerThrowNoSuchMethod(); 2991 registry.registerThrowNoSuchMethod();
2992 } 2992 }
2993 } else if (target.impliesType) { 2993 } else if (target.impliesType) {
2994 setter = warnAndCreateErroneousElement( 2994 setter = warnAndCreateErroneousElement(
2995 node.selector, target.name, MessageKind.ASSIGNING_TYPE); 2995 node.selector, target.name, MessageKind.ASSIGNING_TYPE);
2996 registry.registerThrowNoSuchMethod(); 2996 registry.registerThrowNoSuchMethod();
2997 } else if (target.isFinal || 2997 } else if (target.isFinal || target.isConst) {
2998 target.isConst || 2998 setter = warnAndCreateErroneousElement(
2999 (target.isFunction &&
3000 Elements.isStaticOrTopLevelFunction(target) &&
3001 !target.isSetter)) {
3002 if (target.isFunction) {
3003 setter = warnAndCreateErroneousElement(
3004 node.selector, target.name, MessageKind.ASSIGNING_METHOD);
3005 } else {
3006 setter = warnAndCreateErroneousElement(
3007 node.selector, target.name, MessageKind.CANNOT_RESOLVE_SETTER); 2999 node.selector, target.name, MessageKind.CANNOT_RESOLVE_SETTER);
3008 }
3009 registry.registerThrowNoSuchMethod(); 3000 registry.registerThrowNoSuchMethod();
3001 } else if (target.isFunction && target.name != '[]=') {
3002 assert(!target.isSetter);
Siggi Cherem (dart-lang) 2015/04/11 00:12:21 in your original patch, you had this as part of th
Johnni Winther 2015/04/13 09:41:09 You're right - and I did document isFunction accor
3003 setter = warnAndCreateErroneousElement(
3004 node.selector, target.name, MessageKind.ASSIGNING_METHOD);
3005 registry.registerThrowNoSuchMethod();
3006 if (node.isSuperCall) registry.registerSuperNoSuchMethod();
Siggi Cherem (dart-lang) 2015/04/11 00:12:21 without this, codegen may fail later on (createInv
Johnni Winther 2015/04/13 09:41:09 Nice catch. And you're right about the selectors.
3010 } 3007 }
3011 if (isPotentiallyMutableTarget(target)) { 3008 if (isPotentiallyMutableTarget(target)) {
3012 registry.registerPotentialMutation(target, node); 3009 registry.registerPotentialMutation(target, node);
3013 if (enclosingElement != target.enclosingElement) { 3010 if (enclosingElement != target.enclosingElement) {
3014 registry.registerPotentialMutationInClosure(target, node); 3011 registry.registerPotentialMutationInClosure(target, node);
3015 } 3012 }
3016 for (Node scope in promotionScope) { 3013 for (Node scope in promotionScope) {
3017 registry.registerPotentialMutationIn(scope, target, node); 3014 registry.registerPotentialMutationIn(scope, target, node);
3018 } 3015 }
3019 } 3016 }
(...skipping 2076 matching lines...) Expand 10 before | Expand all | Expand 10 after
5096 } 5093 }
5097 5094
5098 /// The result for the resolution of the `assert` method. 5095 /// The result for the resolution of the `assert` method.
5099 class AssertResult implements ResolutionResult { 5096 class AssertResult implements ResolutionResult {
5100 const AssertResult(); 5097 const AssertResult();
5101 5098
5102 Element get element => null; 5099 Element get element => null;
5103 5100
5104 String toString() => 'AssertResult()'; 5101 String toString() => 'AssertResult()';
5105 } 5102 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698