Fix infer error of macro invocation in array expr
This commit is contained in:
parent
51d29fe554
commit
63e330f402
@ -404,7 +404,7 @@ fn to_fragment_kind(db: &dyn AstDatabase, id: MacroCallId) -> FragmentKind {
|
||||
TRY_EXPR => FragmentKind::Expr,
|
||||
TUPLE_EXPR => FragmentKind::Expr,
|
||||
PAREN_EXPR => FragmentKind::Expr,
|
||||
|
||||
ARRAY_EXPR => FragmentKind::Expr,
|
||||
FOR_EXPR => FragmentKind::Expr,
|
||||
PATH_EXPR => FragmentKind::Expr,
|
||||
CLOSURE_EXPR => FragmentKind::Expr,
|
||||
|
@ -325,6 +325,24 @@ fn infer_paren_macro_call() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn infer_array_macro_call() {
|
||||
check_infer(
|
||||
r#"
|
||||
macro_rules! bar { () => {0u32} }
|
||||
fn test() {
|
||||
let a = [bar!()];
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
!0..4 '0u32': u32
|
||||
44..69 '{ ...()]; }': ()
|
||||
54..55 'a': [u32; _]
|
||||
58..66 '[bar!()]': [u32; _]
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bug_1030() {
|
||||
check_infer(
|
||||
|
Loading…
x
Reference in New Issue
Block a user