Add regression test

so that we can catch regressions when we move away from chalk.
This commit is contained in:
Ryo Yoshida 2023-03-19 16:58:10 +09:00
parent 1d1a86f350
commit e12460bbca
No known key found for this signature in database
GPG key ID: E25698A930586171

View file

@ -1756,3 +1756,35 @@ const C: usize = 2 + 2;
"#,
);
}
#[test]
fn regression_14164() {
check_types(
r#"
trait Rec {
type K;
type Rebind<Tok>: Rec<K = Tok>;
}
trait Expr<K> {
type Part: Rec<K = K>;
fn foo(_: <Self::Part as Rec>::Rebind<i32>) {}
}
struct Head<K>(K);
impl<K> Rec for Head<K> {
type K = K;
type Rebind<Tok> = Head<Tok>;
}
fn test<E>()
where
E: Expr<usize, Part = Head<usize>>,
{
let head;
//^^^^ Head<i32>
E::foo(head);
}
"#,
);
}