You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
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
perl6 -v
orraku -v
): Welcome to Rakudo™ v2021.12. Implementing the Raku® Programming Language v6.d. Built on MoarVM version 2021.12.The text was updated successfully, but these errors were encountered: