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

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

Issue 1423623008: Improve messages and static use for super/this-calls. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 years, 1 month 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
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 library dart2js.resolution; 5 library dart2js.resolution;
6 6
7 import 'dart:collection' show Queue; 7 import 'dart:collection' show Queue;
8 8
9 import '../common.dart'; 9 import '../common.dart';
10 import '../common/names.dart' show 10 import '../common/names.dart' show
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 FunctionElement constructor, 127 FunctionElement constructor,
128 FunctionElement redirection) { 128 FunctionElement redirection) {
129 assert(invariant(node, constructor.isImplementation, 129 assert(invariant(node, constructor.isImplementation,
130 message: 'Redirecting constructors must be resolved on implementation ' 130 message: 'Redirecting constructors must be resolved on implementation '
131 'elements.')); 131 'elements.'));
132 Setlet<FunctionElement> seen = new Setlet<FunctionElement>(); 132 Setlet<FunctionElement> seen = new Setlet<FunctionElement>();
133 seen.add(constructor); 133 seen.add(constructor);
134 while (redirection != null) { 134 while (redirection != null) {
135 // Ensure that we follow redirections through implementation elements. 135 // Ensure that we follow redirections through implementation elements.
136 redirection = redirection.implementation; 136 redirection = redirection.implementation;
137 if (redirection.isError) {
138 break;
139 }
137 if (seen.contains(redirection)) { 140 if (seen.contains(redirection)) {
138 reporter.reportErrorMessage( 141 reporter.reportErrorMessage(
139 node, MessageKind.REDIRECTING_CONSTRUCTOR_CYCLE); 142 node, MessageKind.REDIRECTING_CONSTRUCTOR_CYCLE);
140 return; 143 return;
141 } 144 }
142 seen.add(redirection); 145 seen.add(redirection);
143 redirection = resolver.visitor.resolveConstructorRedirection(redirection); 146 redirection = resolver.visitor.resolveConstructorRedirection(redirection);
144 } 147 }
145 } 148 }
146 149
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 TreeElements get treeElements { 1094 TreeElements get treeElements {
1092 assert(invariant(this, _treeElements !=null, 1095 assert(invariant(this, _treeElements !=null,
1093 message: "TreeElements have not been computed for $this.")); 1096 message: "TreeElements have not been computed for $this."));
1094 return _treeElements; 1097 return _treeElements;
1095 } 1098 }
1096 1099
1097 void reuseElement() { 1100 void reuseElement() {
1098 _treeElements = null; 1101 _treeElements = null;
1099 } 1102 }
1100 } 1103 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | pkg/compiler/lib/src/resolution/send_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698