mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 10:39:45 +00:00
fix variant resolve for type alias
This commit is contained in:
parent
79ec2c584b
commit
2411f1383a
4 changed files with 62 additions and 14 deletions
|
|
@ -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
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue