Navigation Menu

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

submethod Bool isn't called when object used in Boolean context #5163

Closed
p6rt opened this issue Mar 5, 2016 · 5 comments
Closed

submethod Bool isn't called when object used in Boolean context #5163

p6rt opened this issue Mar 5, 2016 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Mar 5, 2016

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

Searchable as RT127660$

@p6rt
Copy link
Author

p6rt commented Mar 5, 2016

From @LLFourn

class A { submethod Bool { True } }; say A || "lose" #-> lose
class A { method Bool { True } }; say A || "lose" #-> # (A)

It looks like we have places where the .^submethod_table is ignored

https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Metamodel/Mixins.nqp#L87

(though not sure if that line is the culprit in this case because the above
are not mixins).

IRC​: http://irclog.perlgeek.de/perl6/2016-03-05#i_12141111

@p6rt
Copy link
Author

p6rt commented Mar 9, 2016

From @jnthn

On Fri Mar 04 21​:02​:59 2016, lloyd.fourn@​gmail.com wrote​:

class A { submethod Bool { True } }; say A || "lose" #-> lose
class A { method Bool { True } }; say A || "lose" #-> # (A)

It looks like we have places where the .^submethod_table is ignored

https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Metamodel/Mixins.nqp#L87

(though not sure if that line is the culprit in this case because the above
are not mixins).

IRC​: http://irclog.perlgeek.de/perl6/2016-03-05#i_12141111

There were two places, both of which are now fixed. Tests in S12-methods/submethods.t and S14-roles/mixin.t.

/jnthn

@p6rt
Copy link
Author

p6rt commented Mar 9, 2016

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

@p6rt
Copy link
Author

p6rt commented Mar 9, 2016

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

@p6rt p6rt closed this as completed Mar 9, 2016
@p6rt
Copy link
Author

p6rt commented Mar 9, 2016

From @LLFourn

Much appreciated. Jnthn++
On Wed, 9 Mar 2016 at 10​:48 PM, jnthn@​jnthn.net via RT <
perl6-bugs-followup@​perl.org> wrote​:

According to our records, your request regarding
"submethod Bool isn't called when object used in Boolean context"
has been resolved.

If you have any further questions or concerns, please respond to this
message.

For other topics, please create a new ticket.

<URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=127660 >

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