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

--> and returns have different behavior #5541

Open
p6rt opened this issue Aug 6, 2016 · 1 comment
Open

--> and returns have different behavior #5541

p6rt opened this issue Aug 6, 2016 · 1 comment

Comments

@p6rt
Copy link

@p6rt p6rt commented Aug 6, 2016

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

Searchable as RT128861$

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Aug 6, 2016

From @ajs

These two commands (circa rakudo-moar 146e18) have different output​:

$ perl6 -e 'class Foo { method bar(--> Str​:D) {} }; say Foo.^methods.map​:
{"{.name}={.WHAT.perl}, returns {.returns.perl}"}'
(bar=Method, returns Str​:D)
$ perl6 -e 'class Foo { method bar() returns Str​:D {} }; say
Foo.^methods.map​: {"{.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​:

rakudo/rakudo#798

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 [teletype@​freeshell.de] 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​: ajs@​ajs.com
Toolsmith, developer, gamer and life-long student.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.