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

Rakudo's call-a-method-on-meta-class .^ is unnecessary fragile #3385

Closed
p6rt opened this issue May 15, 2014 · 4 comments
Closed

Rakudo's call-a-method-on-meta-class .^ is unnecessary fragile #3385

p6rt opened this issue May 15, 2014 · 4 comments

Comments

@p6rt
Copy link

p6rt commented May 15, 2014

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

Searchable as RT121885$

@p6rt
Copy link
Author

p6rt commented May 15, 2014

From @moritz

<moritz> m​: class A { BEGIN {say A.^name } }
<camelia> rakudo-moar ea173d​: OUTPUT«===SORRY!===␤Cannot invoke this object
  (REPR​: Null, cs = 0)␤»

This doesn't work because .^ is implemented as a dispatcher in class Mu;
at the time the .^ call is performed, A isn't fully composed, and thus
the dispatcher​:<.^> from Mu isn't available.

If Rakudo instead rewrote it to A.HOW.name(A) internally, this fragility
could be avoided, thus I consider it a bug.

(Also, the error message is LTA).

@p6rt
Copy link
Author

p6rt commented Oct 13, 2014

From @jnthn

On Thu May 15 12​:43​:22 2014, moritz wrote​:

<moritz> m​: class A { BEGIN {say A.^name } }
<camelia> rakudo-moar ea173d​: OUTPUT«===SORRY!===␤Cannot invoke this object
(REPR​: Null, cs = 0)␤»

This doesn't work because .^ is implemented as a dispatcher in class Mu;
at the time the .^ call is performed, A isn't fully composed, and thus
the dispatcher​:<.^> from Mu isn't available.

If Rakudo instead rewrote it to A.HOW.name(A) internally, this fragility
could be avoided, thus I consider it a bug.

(Also, the error message is LTA).

Fixed now, and tested in S12-introspection/meta-class.t.

@p6rt
Copy link
Author

p6rt commented Oct 13, 2014

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

@p6rt
Copy link
Author

p6rt commented Jan 12, 2015

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

@p6rt p6rt closed this as completed Jan 12, 2015
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