diff options
author | Jonas Schievink <[email protected]> | 2020-07-14 18:57:41 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2020-07-14 18:57:41 +0100 |
commit | a4a8406c449a2c124659773408d0241d54eb243a (patch) | |
tree | 2af71e48e9d3fce856e6cd70d754d03345b1d66d /crates/ra_hir_ty/src/diagnostics | |
parent | a50c64a4f13b47de7fa08eb3e6ff222a96389b28 (diff) |
ItemTree: Lower tuple types despite invalid type
Diffstat (limited to 'crates/ra_hir_ty/src/diagnostics')
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics/expr.rs | 23 |
1 files changed, 23 insertions, 0 deletions
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() { | |||
489 | "#, | 489 | "#, |
490 | ) | 490 | ) |
491 | } | 491 | } |
492 | |||
493 | #[test] | ||
494 | fn enum_variant_type_macro() { | ||
495 | check_diagnostics( | ||
496 | r#" | ||
497 | macro_rules! Type { | ||
498 | () => { u32 }; | ||
499 | } | ||
500 | enum Foo { | ||
501 | Bar(Type![]) | ||
502 | } | ||
503 | impl Foo { | ||
504 | fn new() { | ||
505 | Foo::Bar(0); | ||
506 | Foo::Bar(0, 1); | ||
507 | //^^^^^^^^^^^^^^ Expected 1 argument, found 2 | ||
508 | Foo::Bar(); | ||
509 | //^^^^^^^^^^ Expected 1 argument, found 0 | ||
510 | } | ||
511 | } | ||
512 | "#, | ||
513 | ); | ||
514 | } | ||
492 | } | 515 | } |