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

#rest should accept variable-name BNF, not variable #1430

Open
cgay opened this issue Apr 8, 2022 · 0 comments
Open

#rest should accept variable-name BNF, not variable #1430

cgay opened this issue Apr 8, 2022 · 0 comments
Labels
Compiler Warnings DRM DRM compliance issues

Comments

@cgay
Copy link
Member

cgay commented Apr 8, 2022

I believe both of the examples below should produce compiler warnings. They're the two ways I could imagine interpreting a type spec for a rest parameter. The BNF is #rest variable-name, not #rest variable.

define function foo (#rest things :: <string>)
  format-out("%s\n", things);
end;

foo(1, 2, 3);

define function bar (#rest things :: limited(<sequence>, of: <string>))
  format-out("%s\n", things);
end;

bar(1, 2, 3);

https://play.opendylan.org/shared/ac3d2bab7156132f

@cgay cgay added Compiler Warnings DRM DRM compliance issues labels Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compiler Warnings DRM DRM compliance issues
Projects
None yet
Development

No branches or pull requests

1 participant