mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +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]
|
#[test]
|
||||||
|
#[ignore]
|
||||||
fn phantom_polymorphic() {
|
fn phantom_polymorphic() {
|
||||||
|
// see https://github.com/rtfeldman/roc/issues/786 and below
|
||||||
assert_evals_to!(
|
assert_evals_to!(
|
||||||
indoc!(
|
indoc!(
|
||||||
r"#
|
r"#
|
||||||
|
@ -893,10 +895,16 @@ mod gen_tags {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[ignore]
|
||||||
fn phantom_polymorphic_record() {
|
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!(
|
assert_evals_to!(
|
||||||
indoc!(
|
indoc!(
|
||||||
r"#
|
r#"
|
||||||
|
app "test" provides [ main ] to "./platform"
|
||||||
|
|
||||||
Point coordinate : { coordinate : coordinate, x : I64, y : I64 }
|
Point coordinate : { coordinate : coordinate, x : I64, y : I64 }
|
||||||
|
|
||||||
zero : Point I64
|
zero : Point I64
|
||||||
|
@ -905,8 +913,8 @@ mod gen_tags {
|
||||||
add : Point a -> Point a
|
add : Point a -> Point a
|
||||||
add = \{ coordinate } -> { coordinate, x: 0 + 0, y: 0 }
|
add = \{ coordinate } -> { coordinate, x: 0 + 0, y: 0 }
|
||||||
|
|
||||||
add zero
|
main = add zero
|
||||||
#"
|
"#
|
||||||
),
|
),
|
||||||
(0, 0),
|
(0, 0),
|
||||||
(i64, i64)
|
(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
|
// 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
|
// 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.
|
// 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() {
|
for (pattern_var, pattern) in patterns.into_iter() {
|
||||||
let context = crate::exhaustive::Context::BadArg;
|
let context = crate::exhaustive::Context::BadArg;
|
||||||
let mono_pattern = from_can_pattern(env, layout_cache, &pattern.value);
|
let mono_pattern = from_can_pattern(env, layout_cache, &pattern.value);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue