mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
be smarter
This commit is contained in:
parent
cfccb92bf9
commit
db06c10b5f
4 changed files with 209 additions and 40 deletions
|
@ -5509,4 +5509,42 @@ mod solve_expr {
|
|||
r#"Id [ A, B, C { a : Str }e ] -> Str"#,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inner_annotation_rigid() {
|
||||
infer_eq_without_problem(
|
||||
indoc!(
|
||||
r#"
|
||||
f : a -> a
|
||||
f =
|
||||
g : b -> b
|
||||
g = \x -> x
|
||||
|
||||
g
|
||||
|
||||
f
|
||||
"#
|
||||
),
|
||||
r#"a -> a"#,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inner_annotation_rigid_2() {
|
||||
infer_eq_without_problem(
|
||||
indoc!(
|
||||
r#"
|
||||
f : {} -> List a
|
||||
f =
|
||||
g : List a
|
||||
g = []
|
||||
|
||||
\{} -> g
|
||||
|
||||
f
|
||||
"#
|
||||
),
|
||||
r#"{} -> List a"#,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue