diff --git a/crates/hir-ty/src/tests/regression.rs b/crates/hir-ty/src/tests/regression.rs index e6b4f13c8d..689f0da44f 100644 --- a/crates/hir-ty/src/tests/regression.rs +++ b/crates/hir-ty/src/tests/regression.rs @@ -1756,3 +1756,35 @@ const C: usize = 2 + 2; "#, ); } + +#[test] +fn regression_14164() { + check_types( + r#" +trait Rec { + type K; + type Rebind: Rec; +} + +trait Expr { + type Part: Rec; + fn foo(_: ::Rebind) {} +} + +struct Head(K); +impl Rec for Head { + type K = K; + type Rebind = Head; +} + +fn test() +where + E: Expr>, +{ + let head; + //^^^^ Head + E::foo(head); +} +"#, + ); +}