Chromium Code Reviews| Index: lib/src/checker/rules.dart |
| diff --git a/lib/src/checker/rules.dart b/lib/src/checker/rules.dart |
| index cbca57a9335351247d3f6e9902e1741d584e2c4e..3db1e643f96a4764feebbec2d49d8d227200d512 100644 |
| --- a/lib/src/checker/rules.dart |
| +++ b/lib/src/checker/rules.dart |
| @@ -393,7 +393,7 @@ class RestrictedRules extends TypeRules { |
| final n2s = toT.namedParameterTypes; |
| final ret2 = toT.returnType; |
| - Coercion ret = _coerceTo(ret1, ret2, true); |
| + Coercion ret = _coerceTo(ret1, ret2, options.wrapClosures); |
| // Reject if one has named and the other has optional |
| if (n1s.length > 0 && o2s.length > 0) return Coercion.error(); |
| @@ -456,6 +456,7 @@ class RestrictedRules extends TypeRules { |
| // fromT <: toT, no coercion needed |
| if (isSubTypeOf(fromT, toT)) return Coercion.identity(toT); |
| + // FIXME(vsm): I don't think we need this any more. |
|
Leaf
2015/03/25 21:06:28
Why not?
|
| // Downcasting from dynamic to object always succeeds, |
| // no coercion needed. |
| if (fromT.isDynamic && toT == provider.objectType) { |
| @@ -494,7 +495,7 @@ class RestrictedRules extends TypeRules { |
| StaticInfo checkAssignment(Expression expr, DartType toT, bool constContext) { |
| final fromT = getStaticType(expr); |
| - final Coercion c = _coerceTo(fromT, toT, true); |
| + final Coercion c = _coerceTo(fromT, toT, options.wrapClosures); |
| if (c is Identity) return null; |
| if (c is CoercionError) return new StaticTypeError(this, expr, toT); |
| if (constContext && !options.allowConstCasts) { |