Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/patterns.rs')
| -rw-r--r-- | crates/hir-ty/src/tests/patterns.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/patterns.rs b/crates/hir-ty/src/tests/patterns.rs index 7234af2d68..548f782f4f 100644 --- a/crates/hir-ty/src/tests/patterns.rs +++ b/crates/hir-ty/src/tests/patterns.rs @@ -1155,6 +1155,40 @@ fn main() { } #[test] +fn generic_alias_with_qualified_path() { + check_types( + r#" +type Wrap<T> = T; + +struct S; + +trait Schematic { + type Props; +} + +impl Schematic for S { + type Props = X; +} + +enum X { + A { cool: u32, stuff: u32 }, + B, +} + +fn main() { + let wrapped = Wrap::<<S as Schematic>::Props>::A { + cool: 100, + stuff: 100, + }; + + if let Wrap::<<S as Schematic>::Props>::A { cool, ..} = &wrapped {} + //^^^^ &u32 +} +"#, + ); +} + +#[test] fn type_mismatch_pat_const_reference() { check_no_mismatches( r#" |