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

Negative values are not allowed in --> part of the signature (sub f (--> -42) {}) #5851

Open
p6rt opened this issue Dec 3, 2016 · 1 comment

Comments

@p6rt
Copy link

p6rt commented Dec 3, 2016

Migrated from rt.perl.org#130249 (status was 'new')

Searchable as RT130249$

@p6rt
Copy link
Author

p6rt commented Dec 3, 2016

From @AlexDaniel

Code​:
sub foo (--> 42) {}
say foo

Result​:
42

OK, that works, let's try -42​:

Code​:
sub foo (--> -42) {}
say foo

Result​:
===SORRY!=== Error while compiling -e
Malformed return value
at -e​:1
------> sub foo (-->⏏ -42) {}

「- 42」 is not a constant by itself, yes. But internally we provide a workaround for other places where a negative value may be needed (e.g. 「sub foo(-42)」, so I think this is where we should do it too.

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