mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 15:03:46 +00:00
Add reproduction for recursive ability impl specialization with inference
This commit is contained in:
parent
75ce40c67d
commit
9a60f720d4
1 changed files with 38 additions and 0 deletions
|
@ -6852,6 +6852,44 @@ mod solve_expr {
|
|||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "TODO: this currently runs into trouble with ping and pong first being inferred as overly-general before recursive constraining"]
|
||||
fn resolve_mutually_recursive_ability_lambda_sets_inferred() {
|
||||
infer_queries!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
Bounce has
|
||||
ping : a -> a | a has Bounce
|
||||
pong : a -> a | a has Bounce
|
||||
|
||||
A := {} has [Bounce {ping, pong}]
|
||||
|
||||
ping = \@A {} -> pong (@A {})
|
||||
#^^^^{-1} ^^^^
|
||||
|
||||
pong = \@A {} -> ping (@A {})
|
||||
#^^^^{-1} ^^^^
|
||||
|
||||
main =
|
||||
a : A
|
||||
a = ping (@A {})
|
||||
# ^^^^
|
||||
|
||||
a
|
||||
"#
|
||||
),
|
||||
@r###"
|
||||
A#ping(5) : A -[[ping(5)]]-> A
|
||||
Bounce#pong(3) : A -[[pong(6)]]-> A
|
||||
A#pong(6) : A -[[pong(6)]]-> A
|
||||
A#ping(5) : A -[[ping(5)]]-> A
|
||||
A#ping(5) : A -[[ping(5)]]-> A
|
||||
"###
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_of_lambdas() {
|
||||
infer_queries!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue