diff options
author | Eduardo Julian | 2019-05-28 19:48:42 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-05-28 19:48:42 -0400 |
commit | f55e513690400cce9e5e17a01a98922d91e086c3 (patch) | |
tree | 3d7675501866b7b889f27cde4165fefa47f84515 /stdlib/source | |
parent | fc0b4ad182e8e3099d6337641e97a630db3a8be0 (diff) |
Only infer the record-type during pattern-matching when the input-value's type is unknown.
Diffstat (limited to 'stdlib/source')
-rw-r--r-- | stdlib/source/lux/tool/compiler/phase/analysis/case.lux | 9 |
1 files changed, 7 insertions, 2 deletions
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)] |