ItemTree: Lower tuple types despite invalid type

This commit is contained in:
Jonas Schievink 2020-07-14 19:57:41 +02:00
parent a50c64a4f1
commit a4a8406c44
2 changed files with 29 additions and 7 deletions

View file

@ -489,4 +489,27 @@ fn f() {
"#,
)
}
#[test]
fn enum_variant_type_macro() {
check_diagnostics(
r#"
macro_rules! Type {
() => { u32 };
}
enum Foo {
Bar(Type![])
}
impl Foo {
fn new() {
Foo::Bar(0);
Foo::Bar(0, 1);
//^^^^^^^^^^^^^^ Expected 1 argument, found 2
Foo::Bar();
//^^^^^^^^^^ Expected 1 argument, found 0
}
}
"#,
);
}
}