diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-10-14 15:22:25 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-10-20 18:23:48 -0700 |
| commit | ed985b61d5c1e35b10a135ec8872aec2fbf66531 (patch) | |
| tree | f7acefac8308cd98d9f8fa1492022dcf1926cc2c /src/comp | |
| parent | 354bfc829248965fa23c14cccd8c4db1685f3701 (diff) | |
| download | rust-ed985b61d5c1e35b10a135ec8872aec2fbf66531.tar.gz rust-ed985b61d5c1e35b10a135ec8872aec2fbf66531.zip | |
Bare functions can coerce to blocks
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/middle/typeck.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs index 1e4fe0d6f3c..a62cf5e97d8 100644 --- a/src/comp/middle/typeck.rs +++ b/src/comp/middle/typeck.rs @@ -916,6 +916,10 @@ fn do_fn_ty_coerce(fcx: @fn_ctxt, sp: span, actual: ty::t, expected: ty::t) ty::mk_fn(fcx.ccx.tcx, ast::proto_fn, args, ret_ty, cf, constrs) } + some(ty::ty_fn(ast::proto_block., _, _, _, _)) { + ty::mk_fn(fcx.ccx.tcx, ast::proto_block, args, ret_ty, cf, + constrs) + } _ { actual } } } |
