fix: Stop wrapping ConstParam's default values in ConstArg

This was causing ConstParam::default_val to always return None for block
expressions.

CONST_ARG@24..29
  BLOCK_EXPR@24..29
    ...
This commit is contained in:
Steven Joruk 2022-03-11 19:22:49 +00:00
parent 224a255c5a
commit 972f50da2d
8 changed files with 82 additions and 50 deletions

View file

@ -79,10 +79,13 @@ fn const_param(p: &mut Parser, m: Marker) {
}
if p.at(T![=]) {
// test const_param_defaults
// test const_param_default_literal
// struct A<const N: i32 = -1>;
p.bump(T![=]);
generic_args::const_arg(p);
// test const_param_default_expression
// struct A<const N: i32 = { 1 }>;
generic_args::const_arg_content(p);
}
m.complete(p, CONST_PARAM);