-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Splats parameter with free variable bug #5037
Labels
Comments
asterite
added
kind:bug
A bug in the code. Does not apply to documentation, specs, etc.
topic:compiler
labels
Sep 26, 2017
Free variable is not related because this code reproduces the bug: def foo(x, *y : *{Int32, Int32})
end
foo(1, 2, 3) |
I think it's simply that def foo(x : *Int32)
end
foo(1)
??? |
Nevermind. It is actually a thing, just not in the context of the original post. It's supposed to be def f(x, *y : T) forall T
pp x, y
end
f(1, 2, 3) |
@oprypin yep, it works if you omit first argument def f(*args : *T) forall T
pp args
end
f(1, 2, 3, :a, 'b', "c") |
also my example without first argument works: def foo(*x : *{Int32, Int32})
end
foo(1, 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
https://play.crystal-lang.org/#/r/2spc
Error message :
crystal -v
The text was updated successfully, but these errors were encountered: