From a4a8406c449a2c124659773408d0241d54eb243a Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 14 Jul 2020 19:57:41 +0200 Subject: ItemTree: Lower tuple types despite invalid type --- crates/ra_hir_ty/src/diagnostics/expr.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'crates/ra_hir_ty') diff --git a/crates/ra_hir_ty/src/diagnostics/expr.rs b/crates/ra_hir_ty/src/diagnostics/expr.rs index 91caedc3d..21ff99a8c 100644 --- a/crates/ra_hir_ty/src/diagnostics/expr.rs +++ b/crates/ra_hir_ty/src/diagnostics/expr.rs @@ -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 + } +} + "#, + ); + } } -- cgit v1.2.3