mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
update new test cases
This commit is contained in:
parent
16994cfaf7
commit
d81544b061
2 changed files with 15 additions and 3 deletions
|
@ -870,7 +870,9 @@ mod gen_tags {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn phantom_polymorphic() {
|
||||
// see https://github.com/rtfeldman/roc/issues/786 and below
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r"#
|
||||
|
@ -893,10 +895,16 @@ mod gen_tags {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn phantom_polymorphic_record() {
|
||||
// see https://github.com/rtfeldman/roc/issues/786
|
||||
// also seemed to hit an issue where we check whether `add`
|
||||
// has a Closure layout while the type is not fully specialized yet
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r"#
|
||||
r#"
|
||||
app "test" provides [ main ] to "./platform"
|
||||
|
||||
Point coordinate : { coordinate : coordinate, x : I64, y : I64 }
|
||||
|
||||
zero : Point I64
|
||||
|
@ -905,8 +913,8 @@ mod gen_tags {
|
|||
add : Point a -> Point a
|
||||
add = \{ coordinate } -> { coordinate, x: 0 + 0, y: 0 }
|
||||
|
||||
add zero
|
||||
#"
|
||||
main = add zero
|
||||
"#
|
||||
),
|
||||
(0, 0),
|
||||
(i64, i64)
|
||||
|
|
|
@ -1245,6 +1245,10 @@ fn patterns_to_when<'a>(
|
|||
// patterns that are not yet in a when (e.g. in let or function arguments) must be irrefutable
|
||||
// to pass type checking. So the order in which we add them to the body does not matter: there
|
||||
// are only stores anyway, no branches.
|
||||
//
|
||||
// NOTE this fails if the pattern contains rigid variables,
|
||||
// see https://github.com/rtfeldman/roc/issues/786
|
||||
// this must be fixed when moving exhaustiveness checking to the new canonical AST
|
||||
for (pattern_var, pattern) in patterns.into_iter() {
|
||||
let context = crate::exhaustive::Context::BadArg;
|
||||
let mono_pattern = from_can_pattern(env, layout_cache, &pattern.value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue