From ed985b61d5c1e35b10a135ec8872aec2fbf66531 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 14 Oct 2011 15:22:25 -0700 Subject: Bare functions can coerce to blocks --- src/comp/middle/typeck.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/comp') 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 } } } -- cgit 1.4.1-3-g733a5