Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
elvisxzhou opened this issue Feb 2, 2020 · 0 comments
Open

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

elvisxzhou opened this issue Feb 2, 2020 · 0 comments

Comments

@elvisxzhou
Copy link

elvisxzhou commented Feb 2, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant