Skip to content

Commit acc3811

Browse files
committed
Add support for syn 2.0.40's new Expr::Group to dsl::auto_type
This expression may get yielded when parsing `$a: expr` from other macros.
1 parent ce16e91 commit acc3811

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

dsl_auto_type/src/auto_type/expression_type_inference.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ impl TypeInferrer<'_> {
8282
expr,
8383
type_hint.filter(|h| !matches!(h, syn::Type::Infer(_))),
8484
) {
85+
(syn::Expr::Group(syn::ExprGroup { expr, .. }), type_hint) => {
86+
return self.try_infer_expression_type(expr, type_hint)
87+
}
8588
(
8689
syn::Expr::Tuple(syn::ExprTuple {
8790
elems: expr_elems, ..
@@ -236,10 +239,10 @@ impl TypeInferrer<'_> {
236239
))
237240
}
238241
},
239-
(_, None) => {
242+
(e, None) => {
240243
return Err(syn::Error::new(
241244
expr.span(),
242-
"unsupported expression for auto_type",
245+
format_args!("unsupported expression for auto_type: {e:?}"),
243246
))
244247
}
245248
(_, Some(type_hint)) => type_hint.clone(),

0 commit comments

Comments
 (0)