mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Solve all when branch pattern constraints before solving their bodies
Closes #2886
This commit is contained in:
parent
e0c9931326
commit
2856a38236
2 changed files with 127 additions and 104 deletions
|
@ -5932,4 +5932,21 @@ mod solve_expr {
|
|||
"a -> U64 | a has Hash",
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn when_branch_and_body_flipflop() {
|
||||
infer_eq_without_problem(
|
||||
indoc!(
|
||||
r#"
|
||||
func = \record ->
|
||||
when record.tag is
|
||||
A -> { record & tag: B }
|
||||
B -> { record & tag: A }
|
||||
|
||||
func
|
||||
"#
|
||||
),
|
||||
"{ tag : [ A, B ] }a -> { tag : [ A, B ] }a",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue