fix variant resolve for type alias

This commit is contained in:
austaras 2023-11-26 20:46:02 +08:00
parent 79ec2c584b
commit 2411f1383a
4 changed files with 62 additions and 14 deletions

View file

@ -1129,3 +1129,27 @@ fn foo() {
"#,
);
}
#[test]
fn generic_alias() {
check_types(
r#"
type Wrap<T> = T;
enum X {
A { cool: u32, stuff: u32 },
B,
}
fn main() {
let wrapped = Wrap::<X>::A {
cool: 100,
stuff: 100,
};
if let Wrap::<X>::A { cool, ..} = &wrapped {}
//^^^^ &u32
}
"#,
);
}