Skip to content

Commit e12460b

Browse files
committed
Add regression test
so that we can catch regressions when we move away from chalk.
1 parent 1d1a86f commit e12460b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

crates/hir-ty/src/tests/regression.rs

+32
Original file line numberDiff line numberDiff line change
@@ -1756,3 +1756,35 @@ const C: usize = 2 + 2;
17561756
"#,
17571757
);
17581758
}
1759+
1760+
#[test]
1761+
fn regression_14164() {
1762+
check_types(
1763+
r#"
1764+
trait Rec {
1765+
type K;
1766+
type Rebind<Tok>: Rec<K = Tok>;
1767+
}
1768+
1769+
trait Expr<K> {
1770+
type Part: Rec<K = K>;
1771+
fn foo(_: <Self::Part as Rec>::Rebind<i32>) {}
1772+
}
1773+
1774+
struct Head<K>(K);
1775+
impl<K> Rec for Head<K> {
1776+
type K = K;
1777+
type Rebind<Tok> = Head<Tok>;
1778+
}
1779+
1780+
fn test<E>()
1781+
where
1782+
E: Expr<usize, Part = Head<usize>>,
1783+
{
1784+
let head;
1785+
//^^^^ Head<i32>
1786+
E::foo(head);
1787+
}
1788+
"#,
1789+
);
1790+
}

0 commit comments

Comments
 (0)