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