| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.signatures; | 5 library dart2js.resolution.signatures; |
| 6 | 6 |
| 7 import '../compiler.dart' show | 7 import '../compiler.dart' show |
| 8 Compiler; | 8 Compiler; |
| 9 import '../dart_types.dart'; | 9 import '../dart_types.dart'; |
| 10 import '../diagnostics/invariant.dart' show | 10 import '../diagnostics/invariant.dart' show |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } else if (link.head.asSend() != null && | 141 } else if (link.head.asSend() != null && |
| 142 link.head.asSend().selector.asFunctionExpression() != null) { | 142 link.head.asSend().selector.asFunctionExpression() != null) { |
| 143 // Inline function typed initializing formal or | 143 // Inline function typed initializing formal or |
| 144 // parameter with default value, like `C(int this.f(String s))` or | 144 // parameter with default value, like `C(int this.f(String s))` or |
| 145 // `void m([int f(String s) = null])`. | 145 // `void m([int f(String s) = null])`. |
| 146 computeFunctionType(link.head.asSend().selector.asFunctionExpression()); | 146 computeFunctionType(link.head.asSend().selector.asFunctionExpression()); |
| 147 } else { | 147 } else { |
| 148 assert(invariant(currentDefinitions, | 148 assert(invariant(currentDefinitions, |
| 149 link.head.asIdentifier() != null || link.head.asSend() != null)); | 149 link.head.asIdentifier() != null || link.head.asSend() != null)); |
| 150 if (fieldElement != null) { | 150 if (fieldElement != null) { |
| 151 element.typeCache = fieldElement.computeType(compiler); | 151 element.typeCache = fieldElement.computeType(resolution); |
| 152 } else { | 152 } else { |
| 153 element.typeCache = const DynamicType(); | 153 element.typeCache = const DynamicType(); |
| 154 } | 154 } |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 | 158 |
| 159 FormalElementX visitIdentifier(Identifier node) { | 159 FormalElementX visitIdentifier(Identifier node) { |
| 160 return createParameter(node, null); | 160 return createParameter(node, null); |
| 161 } | 161 } |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 | 440 |
| 441 DartType resolveReturnType(TypeAnnotation annotation) { | 441 DartType resolveReturnType(TypeAnnotation annotation) { |
| 442 if (annotation == null) return const DynamicType(); | 442 if (annotation == null) return const DynamicType(); |
| 443 DartType result = resolver.resolveTypeAnnotation(annotation); | 443 DartType result = resolver.resolveTypeAnnotation(annotation); |
| 444 if (result == null) { | 444 if (result == null) { |
| 445 return const DynamicType(); | 445 return const DynamicType(); |
| 446 } | 446 } |
| 447 return result; | 447 return result; |
| 448 } | 448 } |
| 449 } | 449 } |
| OLD | NEW |