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

LTAness with putting space before sig specifier of Callable #2044

Open
zoffixznet opened this issue Jul 10, 2018 · 0 comments
Open

LTAness with putting space before sig specifier of Callable #2044

zoffixznet opened this issue Jul 10, 2018 · 0 comments

Comments

@zoffixznet
Copy link
Contributor

zoffixznet commented Jul 10, 2018

There is a host of things here, some of which are probably of the DIHWIDT variety, but maybe some could be improved.

This is on 2018.05-54-g148d7c5.


Since spaces are needed to unpack stuff like Arrays in signatures, I wrote a thing like this:

$ perl6 -e 'sub (&s :()) {}'
===SORRY!=== Error while compiling -e
Can only use the : invocant marker in the signature for a method
at -e:1
------> sub (&s :()⏏) {}
    expecting any of:
        constraint

The actual signature was longer, so the cursor was pointing in the wrong place, but eventually I realized that it's the extra space in the signature specifier of the Callable that was causing the problem (maybe that can be included in the error as a suggestion to check?)


However, if you write it that way in places where invocant markers are allowed, you get silence and a signature you did not intend:

$ perl6 -e '.say for :(&s :(), *%_), method (&s :()) {}.signature'
(&s: $ (), *%_)
(&s: $ (), *%_)

Strangelly, though those two signatures gist the same, they smartmatch False:

$ perl6 -e 'say :(&s :(), *%_) ~~ method (&s :()) {}.signature'
False

Also, there's this crash if you remove the space and make the thingie an invocant:

$ perl6 -e 'say :(&s:():)'
No such method 'multi-invocant' for invocant of type 'Any'
  in block <unit> at -e line 1
@zoffixznet zoffixznet changed the title LTAness with putting space before sig unpack of Callable LTAness with putting space before sig specifier of Callable Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant