syntax update: the default value of ConstParam turned from Expr into ConstArg

This commit is contained in:
ponyii 2023-07-10 17:56:07 +04:00
parent 52b4392724
commit 4ebdc6f052
14 changed files with 48 additions and 37 deletions

View file

@ -810,7 +810,7 @@ impl FunctionBody {
(true, konst.body(), Some(sema.to_def(&konst)?.ty(sema.db)))
},
ast::ConstParam(cp) => {
(true, cp.default_val(), Some(sema.to_def(&cp)?.ty(sema.db)))
(true, cp.default_val()?.expr(), Some(sema.to_def(&cp)?.ty(sema.db)))
},
ast::ConstBlockPat(cbp) => {
let expr = cbp.block_expr().map(ast::Expr::BlockExpr);