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

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

Issue 1299413002: Move common identifiers, names and selectors to a separate library. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
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 '../compiler.dart' show 7 import '../compiler.dart' show
8 Compiler, 8 Compiler,
9 isPrivateName; 9 isPrivateName;
10 import '../dart_types.dart'; 10 import '../dart_types.dart';
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 MessageKind kind = MessageKind.CANNOT_FIND_CONSTRUCTOR; 194 MessageKind kind = MessageKind.CANNOT_FIND_CONSTRUCTOR;
195 Map arguments = {'constructorName': ''}; 195 Map arguments = {'constructorName': ''};
196 // TODO(ahe): Why is this a compile-time error? Or if it is an error, 196 // TODO(ahe): Why is this a compile-time error? Or if it is an error,
197 // why do we bother to registerThrowNoSuchMethod below? 197 // why do we bother to registerThrowNoSuchMethod below?
198 compiler.reportError(node, kind, arguments); 198 compiler.reportError(node, kind, arguments);
199 superMember = new ErroneousElementX( 199 superMember = new ErroneousElementX(
200 kind, arguments, '', element); 200 kind, arguments, '', element);
201 registry.registerThrowNoSuchMethod(); 201 registry.registerThrowNoSuchMethod();
202 } else { 202 } else {
203 ConstructorElement superConstructor = superMember; 203 ConstructorElement superConstructor = superMember;
204 Selector callToMatch = new Selector.call("", element.library, 0); 204 Selector callToMatch = new Selector.call(const PublicName(''), 0);
205 superConstructor.computeType(compiler); 205 superConstructor.computeType(compiler);
206 if (!callToMatch.applies(superConstructor, compiler.world)) { 206 if (!callToMatch.applies(superConstructor, compiler.world)) {
207 MessageKind kind = MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT; 207 MessageKind kind = MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT;
208 compiler.reportError(node, kind); 208 compiler.reportError(node, kind);
209 superMember = new ErroneousElementX(kind, {}, '', element); 209 superMember = new ErroneousElementX(kind, {}, '', element);
210 } 210 }
211 } 211 }
212 FunctionElement constructor = 212 FunctionElement constructor =
213 new SynthesizedConstructorElementX.forDefault(superMember, element); 213 new SynthesizedConstructorElementX.forDefault(superMember, element);
214 if (superMember.isErroneous) { 214 if (superMember.isErroneous) {
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 Identifier selector = node.selector.asIdentifier(); 673 Identifier selector = node.selector.asIdentifier();
674 var e = prefixElement.lookupLocalMember(selector.source); 674 var e = prefixElement.lookupLocalMember(selector.source);
675 if (e == null || !e.impliesType) { 675 if (e == null || !e.impliesType) {
676 error(node.selector, MessageKind.CANNOT_RESOLVE_TYPE, 676 error(node.selector, MessageKind.CANNOT_RESOLVE_TYPE,
677 {'typeName': node.selector}); 677 {'typeName': node.selector});
678 return; 678 return;
679 } 679 }
680 loadSupertype(e, node); 680 loadSupertype(e, node);
681 } 681 }
682 } 682 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698