mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
fix
This commit is contained in:
parent
a897e98da4
commit
3fd4e71d21
1 changed files with 2 additions and 2 deletions
|
@ -1546,7 +1546,7 @@ fn (mut c Checker) fn_call(mut node ast.CallExpr, mut continue_check &bool) ast.
|
|||
if arg_typ_sym.kind == .none && param.typ.has_flag(.generic) && !param.typ.has_flag(.option) {
|
||||
c.error('cannot use `none` as generic argument', call_arg.pos)
|
||||
} else if param.typ.has_flag(.generic) && call_arg.expr is ast.ArrayInit
|
||||
&& call_arg.expr.exprs.len == 0 {
|
||||
&& call_arg.expr.typ == ast.void_type {
|
||||
c.error('cannot use empty array as generic argument', call_arg.pos)
|
||||
}
|
||||
param_typ_sym := c.table.sym(param.typ)
|
||||
|
@ -2576,7 +2576,7 @@ fn (mut c Checker) method_call(mut node ast.CallExpr, mut continue_check &bool)
|
|||
}
|
||||
}
|
||||
if exp_arg_typ.has_flag(.generic) {
|
||||
if arg.expr is ast.ArrayInit && arg.expr.exprs.len == 0 {
|
||||
if arg.expr is ast.ArrayInit && arg.expr.typ == ast.void_type {
|
||||
c.error('cannot use empty array as generic argument', arg.pos)
|
||||
}
|
||||
method_concrete_types := if method_generic_names_len == rec_concrete_types.len {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue