Skip Menu |
Report information
Id: 128861
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: ajs <ajs [at]>

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)

Subject: --> and returns have different behavior
To: rakudobug [...]
Date: Sat, 6 Aug 2016 11:21:26 -0400
From: Aaron Sherman <ajs [...]>
Download (untitled) / with headers
text/plain 1.3k
These two commands (circa rakudo-moar 146e18) have different output:

$ perl6 -e 'class Foo { method bar(--> Str:D) {} }; say Foo.^ {"{.name}={.WHAT.perl}, returns {.returns.perl}"}'
(bar=Method, returns Str:D)
$ perl6 -e 'class Foo { method bar() returns Str:D {} }; say Foo.^ {"{.name}={.WHAT.perl}, returns {.returns.perl}"}'
(bar=Method+{Callable[Str:D]}, returns Str:D)

But it seems as if they should have the same output.

This also came up here:

Relevant IRC log:

[11:12] <smls> m: my method bar() returns Str {};  say &bar.^name;
[11:12] <+camelia> rakudo-moar 146e18: OUTPUT«Method+{Callable[Str]}␤»
[11:12] <smls> m: my method bar(--> Str) {};  say &bar.^name;
[11:12] <+camelia> rakudo-moar 146e18: OUTPUT«Method␤»
[11:13] == telex [] has quit [Ping timeout: 258 seconds]
[11:13] <harmil> Uh... am I misunderstanding what "returns" is for or does that not make any sense?
[11:13] <smls> harmil: Seems weird to me too
[11:13] <smls> A leaking implementation detail maybe?
[11:14] <harmil> methinks
[11:14] <ugexe> there are odd differences between (--> RetType) and returns RetType that shouldnt exist

Aaron Sherman, M.:
P: 617-440-4332 Google Talk, Email and Google Plus:
Toolsmith, developer, gamer and life-long student.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at