1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker,cgen: small optimizations for previous commit

This commit is contained in:
Joe Conigliaro 2022-10-06 17:03:48 +11:00
parent 18f0040388
commit 3eff20c5fd
No known key found for this signature in database
GPG Key ID: C12F7136C08206F1
2 changed files with 2 additions and 2 deletions

View File

@ -1050,7 +1050,7 @@ pub fn (mut c Checker) fn_call(mut node ast.CallExpr, mut continue_check &bool)
// in case of variadic make sure to use array elem type for checks
// check_expected_call_arg already does this before checks also.
param_type := if param.typ.has_flag(.variadic) {
c.table.sym(param.typ).array_info().elem_type
param_typ_sym.array_info().elem_type
} else {
param.typ
}

View File

@ -561,7 +561,7 @@ fn (mut g Gen) fn_decl_params(params []ast.Param, scope &ast.Scope, is_variadic
}
mut typ := g.unwrap_generic(param.typ)
if g.pref.translated && g.file.is_translated && param.typ.has_flag(.variadic) {
typ = g.table.sym(g.unwrap_generic(param.typ)).array_info().elem_type.set_flag(.variadic)
typ = g.table.sym(typ).array_info().elem_type.set_flag(.variadic)
}
param_type_sym := g.table.sym(typ)
mut param_type_name := g.typ(typ) // util.no_dots(param_type_sym.name)