commit 883978d16df460a72871edfa287f784c5d58b01c parent 74650bc728a53268192bc9794c5ac9a78da12215 Author: Drew DeVault <sir@cmpwn.com> Date: Tue, 2 Feb 2021 13:44:26 -0500 check: use type hint for match result Diffstat:
M | src/check.c | | | 8 | ++++++-- |
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/check.c b/src/check.c @@ -1063,8 +1063,12 @@ check_expr_match(struct context *ctx, } if (result_type.next) { - expr->result = type_store_lookup_tagged( - ctx->store, &result_type); + if (hint) { + expr->result = hint; + } else { + expr->result = type_store_lookup_tagged( + ctx->store, &result_type); + } struct match_case *_case = expr->match.cases; while (_case) {