From f55e513690400cce9e5e17a01a98922d91e086c3 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 28 May 2019 19:48:42 -0400 Subject: Only infer the record-type during pattern-matching when the input-value's type is unknown. --- stdlib/source/lux/tool/compiler/phase/analysis/case.lux | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'stdlib') diff --git a/stdlib/source/lux/tool/compiler/phase/analysis/case.lux b/stdlib/source/lux/tool/compiler/phase/analysis/case.lux index dff106eb7..4846b8f54 100644 --- a/stdlib/source/lux/tool/compiler/phase/analysis/case.lux +++ b/stdlib/source/lux/tool/compiler/phase/analysis/case.lux @@ -222,8 +222,13 @@ (do ///.monad [record (//structure.normalize record) [members recordT] (//structure.order record) - _ (//type.with-env - (check.check inputT recordT))] + _ (.case inputT + (#.Var _id) + (//type.with-env + (check.check inputT recordT)) + + _ + (wrap []))] (analyse-pattern (#.Some (list.size members)) inputT [cursor (#.Tuple members)] next)) [cursor (#.Tag tag)] -- cgit v1.2.3