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

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

Issue 2341263002: Handle generic factory constructors in kernel_impact (Closed)
Patch Set: Updated cf. comment. Created 4 years, 3 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/resolution/members.dart » ('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) 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 '../common/resolution.dart' show Resolution; 8 import '../common/resolution.dart' show Resolution;
9 import '../constants/constructors.dart' 9 import '../constants/constructors.dart'
10 show 10 show
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 } 612 }
613 } 613 }
614 resolver.registry.setType(expression, result.type); 614 resolver.registry.setType(expression, result.type);
615 return result; 615 return result;
616 } 616 }
617 617
618 ConstructorResult visitTypeAnnotation(TypeAnnotation node) { 618 ConstructorResult visitTypeAnnotation(TypeAnnotation node) {
619 // This is not really resolving a type-annotation, but the name of the 619 // This is not really resolving a type-annotation, but the name of the
620 // constructor. Therefore we allow deferred types. 620 // constructor. Therefore we allow deferred types.
621 DartType type = resolver.resolveTypeAnnotation(node, 621 DartType type = resolver.resolveTypeAnnotation(node,
622 malformedIsError: inConstContext, deferredIsMalformed: false); 622 malformedIsError: inConstContext,
623 deferredIsMalformed: false,
624 registerCheckedModeCheck: false);
623 Send send = node.typeName.asSend(); 625 Send send = node.typeName.asSend();
624 PrefixElement prefix; 626 PrefixElement prefix;
625 if (send != null) { 627 if (send != null) {
626 // The type name is of the form [: prefix . identifier :]. 628 // The type name is of the form [: prefix . identifier :].
627 String name = send.receiver.asIdentifier().source; 629 String name = send.receiver.asIdentifier().source;
628 Element element = lookupInScope(reporter, send, resolver.scope, name); 630 Element element = lookupInScope(reporter, send, resolver.scope, name);
629 if (element != null && element.isPrefix) { 631 if (element != null && element.isPrefix) {
630 prefix = element; 632 prefix = element;
631 } 633 }
632 } 634 }
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 // constructors. 881 // constructors.
880 return null; 882 return null;
881 } 883 }
882 // TODO(johnniwinther): Use [Name] for lookup. 884 // TODO(johnniwinther): Use [Name] for lookup.
883 ConstructorElement constructor = cls.lookupConstructor(constructorName); 885 ConstructorElement constructor = cls.lookupConstructor(constructorName);
884 if (constructor != null) { 886 if (constructor != null) {
885 constructor = constructor.declaration; 887 constructor = constructor.declaration;
886 } 888 }
887 return constructor; 889 return constructor;
888 } 890 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698