opendylan icon indicating copy to clipboard operation
opendylan copied to clipboard

#rest should accept variable-name BNF, not variable

Open cgay opened this issue 3 years ago • 0 comments

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 avatar Apr 08 '22 16:04 cgay