diff options
author | Florian Diebold <[email protected]> | 2019-12-20 15:41:32 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-12-20 17:16:11 +0000 |
commit | 2a8c9100bfb1294a469bc039a5b9597eabed7073 (patch) | |
tree | ae4e2dd0ae2c62baf79ec1197f5ec5f94a7645e5 /crates/ra_hir_def/src/body/lower.rs | |
parent | cfc50ff160d0af2ce5cd931c6d41161abfdb2fbd (diff) |
Handle closure return types
Fixes #2547.
Diffstat (limited to 'crates/ra_hir_def/src/body/lower.rs')
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 853e17bae..be5d17d85 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -372,8 +372,9 @@ where | |||
372 | arg_types.push(type_ref); | 372 | arg_types.push(type_ref); |
373 | } | 373 | } |
374 | } | 374 | } |
375 | let ret_type = e.ret_type().and_then(|r| r.type_ref()).map(TypeRef::from_ast); | ||
375 | let body = self.collect_expr_opt(e.body()); | 376 | let body = self.collect_expr_opt(e.body()); |
376 | self.alloc_expr(Expr::Lambda { args, arg_types, body }, syntax_ptr) | 377 | self.alloc_expr(Expr::Lambda { args, arg_types, ret_type, body }, syntax_ptr) |
377 | } | 378 | } |
378 | ast::Expr::BinExpr(e) => { | 379 | ast::Expr::BinExpr(e) => { |
379 | let lhs = self.collect_expr_opt(e.lhs()); | 380 | let lhs = self.collect_expr_opt(e.lhs()); |