Skip to content

Commit

Permalink
Add test for example found from removing fresh vars in rustc
Browse files Browse the repository at this point in the history
  • Loading branch information
jackh726 committed Dec 1, 2022
1 parent 75aa6cf commit ad8dfa5
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/test/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,3 +847,34 @@ fn recursive_hang() {
}
}
}

#[test]
fn coinductive_wrapper() {
test! {
program {
#[coinductive]
trait Foo {}
struct Wrapper<T> {}

impl<T> Foo for Wrapper<Wrapper<T>>
where
Wrapper<T>: Foo
{}
}

goal {
exists<T> {
Wrapper<T>: Foo
}
} yields[SolverChoice::slg_default()] {
// FIXME: wrong??
expect![["Unique; for<?U0> { substitution [?0 := Wrapper<^0.0>] }"]]
}
}
/*
FIXME: overflows
yields[SolverChoice::recursive_default()] {
expect![[r#"Ambiguous; no inference guidance"#]]
}
*/
}

0 comments on commit ad8dfa5

Please sign in to comment.