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

Signature handling in my (…) is too permissive #3587

Open
AlexDaniel opened this issue Apr 1, 2020 · 0 comments
Open

Signature handling in my (…) is too permissive #3587

AlexDaniel opened this issue Apr 1, 2020 · 0 comments
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@AlexDaniel
Copy link
Contributor

AlexDaniel commented Apr 1, 2020

Code:

my (Str() $x=60 --> Str);
dd $x;
$x = 42;
dd $x;

Result:

Any $x = Any
Int $x = 42

In other words you can apply as many traits as you want but all of them will be silently ignored. These traits are currently not useful for my, but the compiler shouldn't be throwing them away silently.

<jnthn> My worry is if anyone has got such thing in modules

Here are some examples:

@chloekek++ for this discovery.

IRC log

@AlexDaniel AlexDaniel added the LTA Less Than Awesome; typically an error message that could be better label Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better
Projects
None yet
Development

No branches or pull requests

1 participant