| 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 '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../compiler.dart' show | 8 import '../compiler.dart' show |
| 9 Compiler; | 9 Compiler; |
| 10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 bool isFunctionExpression: false}) { | 303 bool isFunctionExpression: false}) { |
| 304 DiagnosticReporter reporter = compiler.reporter; | 304 DiagnosticReporter reporter = compiler.reporter; |
| 305 | 305 |
| 306 SignatureResolver visitor = new SignatureResolver(compiler, element, | 306 SignatureResolver visitor = new SignatureResolver(compiler, element, |
| 307 registry, defaultValuesError: defaultValuesError, | 307 registry, defaultValuesError: defaultValuesError, |
| 308 createRealParameters: createRealParameters); | 308 createRealParameters: createRealParameters); |
| 309 List<Element> parameters = const <Element>[]; | 309 List<Element> parameters = const <Element>[]; |
| 310 int requiredParameterCount = 0; | 310 int requiredParameterCount = 0; |
| 311 if (formalParameters == null) { | 311 if (formalParameters == null) { |
| 312 if (!element.isGetter) { | 312 if (!element.isGetter) { |
| 313 if (element.isErroneous) { | 313 if (element.isMalformed) { |
| 314 // If the element is erroneous, an error should already have been | 314 // If the element is erroneous, an error should already have been |
| 315 // reported. In the case of parse errors, it is possible that there | 315 // reported. In the case of parse errors, it is possible that there |
| 316 // are formal parameters, but something else in the method failed to | 316 // are formal parameters, but something else in the method failed to |
| 317 // parse. So we suppress the message about missing formals. | 317 // parse. So we suppress the message about missing formals. |
| 318 assert(invariant(element, compiler.compilationFailed)); | 318 assert(invariant(element, compiler.compilationFailed)); |
| 319 } else { | 319 } else { |
| 320 reporter.reportErrorMessage(element, MessageKind.MISSING_FORMALS); | 320 reporter.reportErrorMessage(element, MessageKind.MISSING_FORMALS); |
| 321 } | 321 } |
| 322 } | 322 } |
| 323 } else { | 323 } else { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 | 437 |
| 438 DartType resolveReturnType(TypeAnnotation annotation) { | 438 DartType resolveReturnType(TypeAnnotation annotation) { |
| 439 if (annotation == null) return const DynamicType(); | 439 if (annotation == null) return const DynamicType(); |
| 440 DartType result = resolver.resolveTypeAnnotation(annotation); | 440 DartType result = resolver.resolveTypeAnnotation(annotation); |
| 441 if (result == null) { | 441 if (result == null) { |
| 442 return const DynamicType(); | 442 return const DynamicType(); |
| 443 } | 443 } |
| 444 return result; | 444 return result; |
| 445 } | 445 } |
| 446 } | 446 } |
| OLD | NEW |