From 3ea89d553fd2151e8444148ad393b6b2cf35b4af Mon Sep 17 00:00:00 2001 From: Thomas BESSOU Date: Mon, 11 Dec 2023 11:44:06 +0100 Subject: [PATCH] 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. --- dsl_auto_type/src/auto_type/expression_type_inference.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dsl_auto_type/src/auto_type/expression_type_inference.rs b/dsl_auto_type/src/auto_type/expression_type_inference.rs index 5e84406ea13d..840f09fe0282 100644 --- a/dsl_auto_type/src/auto_type/expression_type_inference.rs +++ b/dsl_auto_type/src/auto_type/expression_type_inference.rs @@ -82,6 +82,9 @@ impl TypeInferrer<'_> { expr, type_hint.filter(|h| !matches!(h, syn::Type::Infer(_))), ) { + (syn::Expr::Group(syn::ExprGroup { expr, .. }), type_hint) => { + return self.try_infer_expression_type(expr, type_hint) + } ( syn::Expr::Tuple(syn::ExprTuple { elems: expr_elems, ..