OLD | NEW |
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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 null, | 611 null, |
612 element.name, | 612 element.name, |
613 MessageKind.NOT_A_TYPE, | 613 MessageKind.NOT_A_TYPE, |
614 {'node': diagnosticNode}); | 614 {'node': diagnosticNode}); |
615 } | 615 } |
616 } | 616 } |
617 resolver.registry.setType(expression, result.type); | 617 resolver.registry.setType(expression, result.type); |
618 return result; | 618 return result; |
619 } | 619 } |
620 | 620 |
621 ConstructorResult visitTypeAnnotation(TypeAnnotation node) { | 621 ConstructorResult visitNominalTypeAnnotation(NominalTypeAnnotation node) { |
622 // This is not really resolving a type-annotation, but the name of the | 622 // This is not really resolving a type-annotation, but the name of the |
623 // constructor. Therefore we allow deferred types. | 623 // constructor. Therefore we allow deferred types. |
624 ResolutionDartType type = resolver.resolveTypeAnnotation(node, | 624 ResolutionDartType type = resolver.resolveTypeAnnotation(node, |
625 malformedIsError: inConstContext, | 625 malformedIsError: inConstContext, |
626 deferredIsMalformed: false, | 626 deferredIsMalformed: false, |
627 registerCheckedModeCheck: false); | 627 registerCheckedModeCheck: false); |
628 Send send = node.typeName.asSend(); | 628 Send send = node.typeName.asSend(); |
629 PrefixElement prefix; | 629 PrefixElement prefix; |
630 if (send != null) { | 630 if (send != null) { |
631 // The type name is of the form [: prefix . identifier :]. | 631 // The type name is of the form [: prefix . identifier :]. |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 // constructors. | 884 // constructors. |
885 return null; | 885 return null; |
886 } | 886 } |
887 // TODO(johnniwinther): Use [Name] for lookup. | 887 // TODO(johnniwinther): Use [Name] for lookup. |
888 ConstructorElement constructor = cls.lookupConstructor(constructorName); | 888 ConstructorElement constructor = cls.lookupConstructor(constructorName); |
889 if (constructor != null) { | 889 if (constructor != null) { |
890 constructor = constructor.declaration; | 890 constructor = constructor.declaration; |
891 } | 891 } |
892 return constructor; | 892 return constructor; |
893 } | 893 } |
OLD | NEW |