Nim
Nim copied to clipboard
varargs[typedesc] doesn't work in both proc and template
template test_template(args:varargs[typedesc])=
echo typeof(args[1000])
proc test_proc(args:varargs[typedesc])=
echo typeof(args[1000])
test_template(string) # it's ok, but 'echo typeof(args[0] | args[1] | args[1000])' all work
test_proc(string) # Error: internal error: getTypeDescAux(tyNone)
test_template(string,int) # Error: type mismatch
test_proc(string,int) # Error: type mismatch
see: https://play.nim-lang.org/#ix=28ZA