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

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

Issue 1089463003: Do not use erroneouselement unless the member is static (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/co19/co19-dart2js.status » ('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 2994 matching lines...) Expand 10 before | Expand all | Expand 10 after
3005 if (isComplex && getter == null && !inInstanceContext) { 3005 if (isComplex && getter == null && !inInstanceContext) {
3006 getter = reportAndCreateErroneousElement(node.selector, field.name, 3006 getter = reportAndCreateErroneousElement(node.selector, field.name,
3007 MessageKind.CANNOT_RESOLVE_GETTER, const {}); 3007 MessageKind.CANNOT_RESOLVE_GETTER, const {});
3008 registry.registerThrowNoSuchMethod(); 3008 registry.registerThrowNoSuchMethod();
3009 } 3009 }
3010 } else if (target.impliesType) { 3010 } else if (target.impliesType) {
3011 setter = reportAndCreateErroneousElement(node.selector, target.name, 3011 setter = reportAndCreateErroneousElement(node.selector, target.name,
3012 MessageKind.ASSIGNING_TYPE, const {}); 3012 MessageKind.ASSIGNING_TYPE, const {});
3013 registry.registerThrowNoSuchMethod(); 3013 registry.registerThrowNoSuchMethod();
3014 } else if (target.isFinal || target.isConst) { 3014 } else if (target.isFinal || target.isConst) {
3015 setter = reportAndCreateErroneousElement( 3015 if (Elements.isStaticOrTopLevelField(target) || target.isLocal) {
3016 setter = reportAndCreateErroneousElement(
3016 node.selector, target.name, MessageKind.CANNOT_RESOLVE_SETTER, 3017 node.selector, target.name, MessageKind.CANNOT_RESOLVE_SETTER,
3017 const {}); 3018 const {});
3019 } else {
3020 // For instance fields we don't report a warning here because the type
3021 // checker will detect this as well and report a better error message
3022 // with the context of the containing class.
3023 }
3018 registry.registerThrowNoSuchMethod(); 3024 registry.registerThrowNoSuchMethod();
3025 if (node.isSuperCall) registry.registerSuperNoSuchMethod();
Johnni Winther 2015/04/16 07:41:05 This case should create an ErrenousElement since t
Siggi Cherem (dart-lang) 2015/04/16 15:49:44 Interesting - I'll create a follow up CL with this
Siggi Cherem (dart-lang) 2015/04/16 19:58:15 I tried this out, but I think this makes the errro
3019 } else if (target.isFunction && target.name != '[]=') { 3026 } else if (target.isFunction && target.name != '[]=') {
3020 assert(!target.isSetter); 3027 assert(!target.isSetter);
3021 setter = reportAndCreateErroneousElement( 3028 if (Elements.isStaticOrTopLevelFunction(target) || target.isLocal) {
3022 node.selector, target.name, MessageKind.ASSIGNING_METHOD, const {}); 3029 setter = reportAndCreateErroneousElement(
3030 node.selector, target.name, MessageKind.ASSIGNING_METHOD,
3031 const {});
3032 } else {
3033 // For instance methods we don't report a warning here because the
3034 // type checker will detect this as well and report a better error
3035 // message with the context of the containing class.
3036 }
3023 registry.registerThrowNoSuchMethod(); 3037 registry.registerThrowNoSuchMethod();
3024 if (node.isSuperCall) registry.registerSuperNoSuchMethod(); 3038 if (node.isSuperCall) registry.registerSuperNoSuchMethod();
3025 } 3039 }
3026 if (isPotentiallyMutableTarget(target)) { 3040 if (isPotentiallyMutableTarget(target)) {
3027 registry.registerPotentialMutation(target, node); 3041 registry.registerPotentialMutation(target, node);
3028 if (enclosingElement != target.enclosingElement) { 3042 if (enclosingElement != target.enclosingElement) {
3029 registry.registerPotentialMutationInClosure(target, node); 3043 registry.registerPotentialMutationInClosure(target, node);
3030 } 3044 }
3031 for (Node scope in promotionScope) { 3045 for (Node scope in promotionScope) {
3032 registry.registerPotentialMutationIn(scope, target, node); 3046 registry.registerPotentialMutationIn(scope, target, node);
(...skipping 2078 matching lines...) Expand 10 before | Expand all | Expand 10 after
5111 } 5125 }
5112 5126
5113 /// The result for the resolution of the `assert` method. 5127 /// The result for the resolution of the `assert` method.
5114 class AssertResult implements ResolutionResult { 5128 class AssertResult implements ResolutionResult {
5115 const AssertResult(); 5129 const AssertResult();
5116 5130
5117 Element get element => null; 5131 Element get element => null;
5118 5132
5119 String toString() => 'AssertResult()'; 5133 String toString() => 'AssertResult()';
5120 } 5134 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698