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

multi keyword leads to sub not being found #2658

Closed
p6rt opened this issue Feb 29, 2012 · 5 comments
Closed

multi keyword leads to sub not being found #2658

p6rt opened this issue Feb 29, 2012 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Feb 29, 2012

Migrated from rt.perl.org#111454 (status was 'resolved')

Searchable as RT111454$

@p6rt
Copy link
Author

p6rt commented Feb 29, 2012

From michael+rakudobug@stapelberg.de

Hi,

short reminder from #perl6​:

23​:13 jnthn> nom​: module Foo { our sub bar() { say 42 } }; Foo​::bar()
23​:13 +p6eval> nom 4726db​: OUTPUT«42␤»
23​:13 jnthn> nom​: module Foo { our multi bar() { say 42 } }; Foo​::bar()
23​:13 +p6eval> nom 4726db​: OUTPUT«Could not find symbol 'Foo​::&bar'␤ in block <anon> at /tmp/bpK6Dt3NSn​:1␤␤»
23​:13 jnthn> Bingo.
23​:13 jnthn> That's a bug.

Best regards,
Michael

@p6rt
Copy link
Author

p6rt commented Apr 30, 2012

From @jnthn

On Wed Feb 29 14​:19​:43 2012, michael+rakudobug@​stapelberg.de wrote​:

Hi,

short reminder from #perl6​:

23​:13 jnthn> nom​: module Foo { our sub bar() { say 42 } }; Foo​::bar()
23​:13 +p6eval> nom 4726db​: OUTPUT«42␤»
23​:13 jnthn> nom​: module Foo { our multi bar() { say 42 } };
Foo​::bar()
23​:13 +p6eval> nom 4726db​: OUTPUT«Could not find symbol 'Foo​::&bar'␤
in block <anon> at /tmp/bpK6Dt3NSn​:1␤␤»
23​:13 jnthn> Bingo.
23​:13 jnthn> That's a bug.

Rather than silently failing, this now helpfully says what to do​:

module Foo { our multi bar() { say 42 } }; Foo​::bar()
Cannot use 'our' with individual multi candidates. Please declare an
our-scoped proto instead

Since multi really means associate with the controlling proto, having
them carry their own scope declarators is a bit dubious. Yu can get the
desired effect with​:

module Foo { our proto bar { * }; multi bar() { say 42 } }; Foo​::bar()
42

Which probably wants test coverage, so tagging this testneeded.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Apr 30, 2012

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented May 4, 2012

From @moritz

now tested in S06-multi/proto.t

@p6rt
Copy link
Author

p6rt commented May 4, 2012

@moritz - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant