mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
fix problem with patterns and optional record fields
This commit is contained in:
parent
099c56fcf6
commit
4868c0bd25
2 changed files with 10 additions and 3 deletions
|
@ -1347,9 +1347,14 @@ fn to_pending_def<'a>(
|
|||
body_expr,
|
||||
} => {
|
||||
if ann_pattern.value.equivalent(&body_pattern.value) {
|
||||
// NOTE: Pick the body pattern, picking the annotation one is
|
||||
// incorrect in the presence of optional record fields!
|
||||
//
|
||||
// { x, y } : { x : Int, y ? Bool }*
|
||||
// { x, y ? False } = rec
|
||||
Some(pending_typed_body(
|
||||
env,
|
||||
ann_pattern,
|
||||
body_pattern,
|
||||
ann_type,
|
||||
body_expr,
|
||||
var_store,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue