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

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

Issue 1416253002: Remove requiredTypes (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. 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.constructors; 5 library dart2js.resolution.constructors;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../compiler.dart' show 8 import '../compiler.dart' show
9 Compiler; 9 Compiler;
10 import '../constants/constructors.dart' show 10 import '../constants/constructors.dart' show
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 return result; 560 return result;
561 } 561 }
562 562
563 ConstructorResult visitTypeAnnotation(TypeAnnotation node) { 563 ConstructorResult visitTypeAnnotation(TypeAnnotation node) {
564 // This is not really resolving a type-annotation, but the name of the 564 // This is not really resolving a type-annotation, but the name of the
565 // constructor. Therefore we allow deferred types. 565 // constructor. Therefore we allow deferred types.
566 DartType type = resolver.resolveTypeAnnotation( 566 DartType type = resolver.resolveTypeAnnotation(
567 node, 567 node,
568 malformedIsError: inConstContext, 568 malformedIsError: inConstContext,
569 deferredIsMalformed: false); 569 deferredIsMalformed: false);
570 registry.registerRequiredType(type, resolver.enclosingElement);
571 return constructorResultForType(node, type); 570 return constructorResultForType(node, type);
572 } 571 }
573 572
574 ConstructorResult visitSend(Send node) { 573 ConstructorResult visitSend(Send node) {
575 ConstructorResult receiver = visit(node.receiver); 574 ConstructorResult receiver = visit(node.receiver);
576 assert(invariant(node.receiver, receiver != null, 575 assert(invariant(node.receiver, receiver != null,
577 message: 'No result returned for $node.receiver.')); 576 message: 'No result returned for $node.receiver.'));
578 if (receiver.kind != null) { 577 if (receiver.kind != null) {
579 assert(invariant(node, receiver.element.isErroneous, 578 assert(invariant(node, receiver.element.isErroneous,
580 message: "Unexpected prefix result: $receiver.")); 579 message: "Unexpected prefix result: $receiver."));
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 // constructors. 753 // constructors.
755 return null; 754 return null;
756 } 755 }
757 // TODO(johnniwinther): Use [Name] for lookup. 756 // TODO(johnniwinther): Use [Name] for lookup.
758 ConstructorElement constructor = cls.lookupConstructor(constructorName); 757 ConstructorElement constructor = cls.lookupConstructor(constructorName);
759 if (constructor != null) { 758 if (constructor != null) {
760 constructor = constructor.declaration; 759 constructor = constructor.declaration;
761 } 760 }
762 return constructor; 761 return constructor;
763 } 762 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend_impact.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698