| Index: lib/src/codegen/reify_coercions.dart
|
| diff --git a/lib/src/codegen/reify_coercions.dart b/lib/src/codegen/reify_coercions.dart
|
| index f9165c9bb80df5bf4401dc286f0894e74487e9a5..ce20aeceab08fc439a4af90cef99087ee2bdbd69 100644
|
| --- a/lib/src/codegen/reify_coercions.dart
|
| +++ b/lib/src/codegen/reify_coercions.dart
|
| @@ -39,6 +39,15 @@ class _Inference extends DownwardsInference {
|
| _Inference(TypeRules rules, this._tm) : super(rules);
|
|
|
| @override
|
| + void annotateCastFromDynamic(Expression e, DartType t) {
|
| + var cast = Coercion.cast(e.staticType, t);
|
| + var node = new DynamicCast(rules, e, cast);
|
| + if (!NodeReplacer.replace(e, node)) {
|
| + _log.severe("Failed to replace node for DownCast");
|
| + }
|
| + }
|
| +
|
| + @override
|
| void annotateListLiteral(ListLiteral e, List<DartType> targs) {
|
| var tNames = targs.map(_tm.typeNameFromDartType).toList();
|
| e.typeArguments = AstBuilder.typeArgumentList(tNames);
|
| @@ -65,6 +74,12 @@ class _Inference extends DownwardsInference {
|
| var rawType = (e.staticType.element as ClassElement).type;
|
| e.staticType = rawType.substitute4(targs);
|
| }
|
| +
|
| + @override
|
| + void annotateFunctionExpression(FunctionExpression e, DartType returnType) {
|
| + // Implicitly changes e.staticType
|
| + (e.element as ExecutableElementImpl).returnType = returnType;
|
| + }
|
| }
|
|
|
| // This class implements a pass which modifies (in place) the ast replacing
|
|
|