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:
parent
18f0040388
commit
3eff20c5fd
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user