Print alias's underlying structures if OIOP vars are material

This commit is contained in:
Ayaz Hafiz 2022-10-26 15:52:50 -05:00
parent e1b6e0334b
commit 9854f5f2ac
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
3 changed files with 49 additions and 4 deletions

View file

@ -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]*
"###
);
}
}