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

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

Issue 1438453002: Use Feature directly in resolution. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.class_hierarchy; 5 library dart2js.resolution.class_hierarchy;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/resolution.dart' show
9 Feature;
8 import '../compiler.dart' show 10 import '../compiler.dart' show
9 Compiler; 11 Compiler;
10 import '../core_types.dart' show 12 import '../core_types.dart' show
11 CoreClasses, 13 CoreClasses,
12 CoreTypes; 14 CoreTypes;
13 import '../dart_types.dart'; 15 import '../dart_types.dart';
14 import '../elements/elements.dart'; 16 import '../elements/elements.dart';
15 import '../elements/modelx.dart' show 17 import '../elements/modelx.dart' show
16 BaseClassElementX, 18 BaseClassElementX,
17 ErroneousElementX, 19 ErroneousElementX,
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 if (!element.hasConstructor) { 196 if (!element.hasConstructor) {
195 Element superMember = element.superclass.localLookup(''); 197 Element superMember = element.superclass.localLookup('');
196 if (superMember == null) { 198 if (superMember == null) {
197 MessageKind kind = MessageKind.CANNOT_FIND_UNNAMED_CONSTRUCTOR; 199 MessageKind kind = MessageKind.CANNOT_FIND_UNNAMED_CONSTRUCTOR;
198 Map arguments = {'className': element.superclass.name}; 200 Map arguments = {'className': element.superclass.name};
199 // TODO(ahe): Why is this a compile-time error? Or if it is an error, 201 // TODO(ahe): Why is this a compile-time error? Or if it is an error,
200 // why do we bother to registerThrowNoSuchMethod below? 202 // why do we bother to registerThrowNoSuchMethod below?
201 reporter.reportErrorMessage(node, kind, arguments); 203 reporter.reportErrorMessage(node, kind, arguments);
202 superMember = new ErroneousElementX( 204 superMember = new ErroneousElementX(
203 kind, arguments, '', element); 205 kind, arguments, '', element);
204 registry.registerThrowNoSuchMethod(); 206 registry.registerFeature(Feature.THROW_NO_SUCH_METHOD);
205 } else if (!superMember.isGenerativeConstructor) { 207 } else if (!superMember.isGenerativeConstructor) {
206 MessageKind kind = MessageKind.SUPER_CALL_TO_FACTORY; 208 MessageKind kind = MessageKind.SUPER_CALL_TO_FACTORY;
207 Map arguments = {'className': element.superclass.name}; 209 Map arguments = {'className': element.superclass.name};
208 // TODO(ahe): Why is this a compile-time error? Or if it is an error, 210 // TODO(ahe): Why is this a compile-time error? Or if it is an error,
209 // why do we bother to registerThrowNoSuchMethod below? 211 // why do we bother to registerThrowNoSuchMethod below?
210 reporter.reportErrorMessage(node, kind, arguments); 212 reporter.reportErrorMessage(node, kind, arguments);
211 superMember = new ErroneousElementX( 213 superMember = new ErroneousElementX(
212 kind, arguments, '', element); 214 kind, arguments, '', element);
213 registry.registerThrowNoSuchMethod(); 215 registry.registerFeature(Feature.THROW_NO_SUCH_METHOD);
214 } else { 216 } else {
215 ConstructorElement superConstructor = superMember; 217 ConstructorElement superConstructor = superMember;
216 superConstructor.computeType(resolution); 218 superConstructor.computeType(resolution);
217 if (!CallStructure.NO_ARGS.signatureApplies( 219 if (!CallStructure.NO_ARGS.signatureApplies(
218 superConstructor.functionSignature)) { 220 superConstructor.functionSignature)) {
219 MessageKind kind = MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT; 221 MessageKind kind = MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT;
220 reporter.reportErrorMessage(node, kind); 222 reporter.reportErrorMessage(node, kind);
221 superMember = new ErroneousElementX(kind, {}, '', element); 223 superMember = new ErroneousElementX(kind, {}, '', element);
222 } 224 }
223 } 225 }
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 if (e == null || !e.impliesType) { 718 if (e == null || !e.impliesType) {
717 reporter.reportErrorMessage( 719 reporter.reportErrorMessage(
718 node.selector, 720 node.selector,
719 MessageKind.CANNOT_RESOLVE_TYPE, 721 MessageKind.CANNOT_RESOLVE_TYPE,
720 {'typeName': node.selector}); 722 {'typeName': node.selector});
721 return; 723 return;
722 } 724 }
723 loadSupertype(e, node); 725 loadSupertype(e, node);
724 } 726 }
725 } 727 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend_impact.dart ('k') | pkg/compiler/lib/src/resolution/constructors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698