Add test for #1165

Closes #1165
This commit is contained in:
Jonas Schievink 2021-02-10 18:42:35 +01:00
parent 612e6843f1
commit 925c51aef3

View file

@ -2462,3 +2462,32 @@ fn infer_nested_inner_type() {
"#]],
);
}
#[test]
fn inner_use_enum_rename() {
check_infer(
r#"
enum Request {
Info
}
fn f() {
use Request as R;
let r = R::Info;
match r {
R::Info => {}
}
}
"#,
expect![[r#"
34..123 '{ ... } }': ()
67..68 'r': Request
71..78 'R::Info': Request
84..121 'match ... }': ()
90..91 'r': Request
102..109 'R::Info': Request
113..115 '{}': ()
"#]],
)
}