mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Print alias's underlying structures if OIOP vars are material
This commit is contained in:
parent
e1b6e0334b
commit
9854f5f2ac
3 changed files with 49 additions and 4 deletions
|
@ -8167,4 +8167,33 @@ mod solve_expr {
|
|||
@"walkHelp {} : [Break [], Continue {}]"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn contextual_openness_for_type_alias() {
|
||||
infer_queries!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [accum] to "./platform"
|
||||
|
||||
Q : [Green, Blue]
|
||||
|
||||
f : Q -> Q
|
||||
f = \q -> when q is
|
||||
#^{-1}
|
||||
Green -> Green
|
||||
Blue -> Blue
|
||||
|
||||
accum = \q -> when q is
|
||||
#^^^^^{-1}
|
||||
A -> f Green
|
||||
B -> Yellow
|
||||
C -> Orange
|
||||
"#
|
||||
),
|
||||
@r###"
|
||||
f : Q -[[f(2)]]-> Q
|
||||
accum : [A, B, C] -[[accum(0)]]-> [Blue, Green, Orange, Yellow]*
|
||||
"###
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue