Nim icon indicating copy to clipboard operation
Nim copied to clipboard

varargs[typedesc] doesn't work in both proc and template

Open elvisxzhou opened this issue 5 years ago • 0 comments

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

elvisxzhou avatar Feb 02 '20 14:02 elvisxzhou