OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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.members; | 5 library dart2js.resolution.members; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/names.dart' show Selectors; | 8 import '../common/names.dart' show Selectors; |
9 import '../common/resolution.dart' show Resolution; | 9 import '../common/resolution.dart' show Resolution; |
10 import '../compile_time_constants.dart'; | 10 import '../compile_time_constants.dart'; |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 addToScope(parameterElement); | 449 addToScope(parameterElement); |
450 } | 450 } |
451 parameterNodes = parameterNodes.tail; | 451 parameterNodes = parameterNodes.tail; |
452 }); | 452 }); |
453 addDeferredAction(enclosingElement, () { | 453 addDeferredAction(enclosingElement, () { |
454 functionSignature.forEachOptionalParameter((ParameterElementX parameter) { | 454 functionSignature.forEachOptionalParameter((ParameterElementX parameter) { |
455 parameter.constant = | 455 parameter.constant = |
456 resolver.constantCompiler.compileConstant(parameter); | 456 resolver.constantCompiler.compileConstant(parameter); |
457 }); | 457 }); |
458 }); | 458 }); |
| 459 if (!functionSignature.returnType.isDynamic) { |
| 460 registry.registerTypeUse( |
| 461 new TypeUse.checkedModeCheck(functionSignature.returnType)); |
| 462 } |
459 functionSignature.forEachParameter((ParameterElement element) { | 463 functionSignature.forEachParameter((ParameterElement element) { |
460 registry.registerTypeUse(new TypeUse.checkedModeCheck(element.type)); | 464 if (!element.type.isDynamic) { |
| 465 registry.registerTypeUse(new TypeUse.checkedModeCheck(element.type)); |
| 466 } |
461 }); | 467 }); |
462 } | 468 } |
463 | 469 |
464 ResolutionResult visitAssert(Assert node) { | 470 ResolutionResult visitAssert(Assert node) { |
465 if (!options.enableAssertMessage) { | 471 if (!options.enableAssertMessage) { |
466 if (node.hasMessage) { | 472 if (node.hasMessage) { |
467 reporter.reportErrorMessage( | 473 reporter.reportErrorMessage( |
468 node, MessageKind.EXPERIMENTAL_ASSERT_MESSAGE); | 474 node, MessageKind.EXPERIMENTAL_ASSERT_MESSAGE); |
469 } | 475 } |
470 } | 476 } |
(...skipping 4251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4722 } | 4728 } |
4723 return const NoneResult(); | 4729 return const NoneResult(); |
4724 } | 4730 } |
4725 } | 4731 } |
4726 | 4732 |
4727 /// Looks up [name] in [scope] and unwraps the result. | 4733 /// Looks up [name] in [scope] and unwraps the result. |
4728 Element lookupInScope( | 4734 Element lookupInScope( |
4729 DiagnosticReporter reporter, Node node, Scope scope, String name) { | 4735 DiagnosticReporter reporter, Node node, Scope scope, String name) { |
4730 return Elements.unwrap(scope.lookup(name), reporter, node); | 4736 return Elements.unwrap(scope.lookup(name), reporter, node); |
4731 } | 4737 } |
OLD | NEW |