fix using #[hdl] types like S<{ 1 + 2 }>

This commit is contained in:
Jacob Lifshay 2024-10-30 20:46:11 -07:00
parent 5bd0de48b7
commit 20cf0abbcc
Signed by: programmerjake
SSH key fingerprint: SHA256:B1iRVvUJkvd7upMIiMqn6OyxvD2SgJkAH3ZnUOj6z+c

View file

@ -4163,7 +4163,13 @@ impl MakeHdlTypeExpr for ParsedExpr {
match self {
ParsedExpr::Delimited(expr) => expr.make_hdl_type_expr(context),
ParsedExpr::NamedParamConst(expr) => expr.make_hdl_type_expr(context),
ParsedExpr::Other(expr) => (**expr).clone(),
ParsedExpr::Other(expr) => {
let span = expr.span();
let const_usize = known_items::ConstUsize(span);
parse_quote_spanned! {expr.span()=>
#const_usize::<{ #expr }>
}
}
}
}
}