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

can't use static seq[string] = ... param #9863

Open
timotheecour opened this issue Dec 5, 2018 · 1 comment
Open

can't use static seq[string] = ... param #9863

timotheecour opened this issue Dec 5, 2018 · 1 comment

Comments

@timotheecour
Copy link
Member

timotheecour commented Dec 5, 2018

how can one use a static param of type seq? (note: I don't want to use an array as that would tie default value to be of same length as the param, which is useless for example when default value is @[])

following code fails:

Error: type mismatch: got <static[array[0..-1, empty]]([])> but expected 'static[seq[string]]'
  macro foo(a: static seq[string] = @[]): untyped = discard
macro foo(a: static seq[string] = @[]): untyped = discard
proc main()=
  foo()
main()

this affects c-blake/cligen#66 (comment)

@timotheecour
Copy link
Member Author

timotheecour commented Feb 13, 2019

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