mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
add test of integer type inference let polymorphism
This commit is contained in:
parent
0297e47fa1
commit
c4ddeefed9
1 changed files with 22 additions and 0 deletions
|
@ -4315,4 +4315,26 @@ mod solve_expr {
|
||||||
"Str",
|
"Str",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn int_type_let_polymorphism() {
|
||||||
|
infer_eq_without_problem(
|
||||||
|
indoc!(
|
||||||
|
r#"
|
||||||
|
app "test" provides [ main ] to "./platform"
|
||||||
|
|
||||||
|
x = 4
|
||||||
|
|
||||||
|
f : U8 -> U32
|
||||||
|
f = \z -> Num.intCast z
|
||||||
|
|
||||||
|
y = f x
|
||||||
|
|
||||||
|
main =
|
||||||
|
x
|
||||||
|
"#
|
||||||
|
),
|
||||||
|
"Num *",
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue