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

Return type arrow syntax error on negative values #4851

Open
2colours opened this issue Apr 5, 2022 · 0 comments
Open

Return type arrow syntax error on negative values #4851

2colours opened this issue Apr 5, 2022 · 0 comments

Comments

@2colours
Copy link
Contributor

2colours commented Apr 5, 2022

The Problem

The return type arrow can take constants as the return value of the function, including decimal fractions: however the parsing fails on the unary minus of negative numbers.

Expected Behavior

sub f(--> -1) {}
should compile, with f returning -1.

Actual Behavior

The following error message is shown:
===SORRY!=== Error while compiling:
Malformed return value
------> sub f(-->⏏ -1) {}

Steps to Reproduce

Define any function with a negative numeric literal as the arrow return value, as opposed to its positive counterpart.

Environment

  • Operating system: 5.4.0-47-generic 51-Ubuntu SMP Fri Sep 4 19:50:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Compiler version (perl6 -v or raku -v): Welcome to Rakudo™ v2021.12. Implementing the Raku® Programming Language v6.d. Built on MoarVM version 2021.12.
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