V: Ability to call variadic functions without any arguments

Created on 8 Nov 2019  路  2Comments  路  Source: vlang/v

Currently if you call a variadic function without any arguments, it results in quite a verbose error.
e.g.

fn variadic(args ...string){}
fn main(){
   variadic() //error
}

Either this should be handled properly i.e. output a proper error that you cannot call a variadic function without arguments or vargs should be treated as an array and should default to an empty array in case there are no arguments.

Bug Confirmed Compiler Type System

Most helpful comment

Indeed, your example should work.

All 2 comments

Indeed, your example should work.

Fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vtereshkov picture vtereshkov  路  3Comments

markgraydev picture markgraydev  路  3Comments

aurora picture aurora  路  3Comments

XVilka picture XVilka  路  3Comments

clpo13 picture clpo13  路  3Comments