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

Cannot parse an anonymous sigilless parameter with a trait #5029

Open
Kaiepi opened this issue Aug 15, 2022 · 0 comments
Open

Cannot parse an anonymous sigilless parameter with a trait #5029

Kaiepi opened this issue Aug 15, 2022 · 0 comments

Comments

@Kaiepi
Copy link
Contributor

Kaiepi commented Aug 15, 2022

The Problem

Given sigilless variables are being looked at, a trait may be applied to an anonymous scalar parameter:

LAPTOP-7I9RCT0C:~% raku -e 'sub ($ is readonly) { }(1)'
LAPTOP-7I9RCT0C:~%

But not an anonymous term:

LAPTOP-7I9RCT0C:~% raku -e 'sub (\ is readonly) { }(1)'

Expected Behavior

Should just return like the anonymous scalar case.

Actual Behavior

Throws:

===SORRY!=== Error while compiling -e
Invalid typename 'is' in parameter declaration.
at -e:1
------> sub (\ is⏏ readonly) { }(1)

Steps to Reproduce

Run the given golf.

Environment

  • Operating system:
Linux LAPTOP-7I9RCT0C 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 GNU/Linux
  • Compiler version (perl6 -v or raku -v):
Welcome to Rakudo™ v2022.07-13-g10feda116.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2022.07-2-g5e3ea9ce8.
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