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

Method list returned by .can() not stringifying #1948

Closed
p6rt opened this issue Jul 19, 2010 · 6 comments
Closed

Method list returned by .can() not stringifying #1948

p6rt opened this issue Jul 19, 2010 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Jul 19, 2010

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

Searchable as RT76584$

@p6rt
Copy link
Author

p6rt commented Jul 19, 2010

From audreyt.org@me.com

# Fails​: get_string() not implemented in class 'P6Invocation'
class C { method M {} }; say C.new.can('M')

# ok
class C { method M {} }; say 'ok' if C.new.can('M')

---- log ---

23​:32 <@​jnthn> P6Invocation ain't meant to leak out
23​:34 <@​au|irc> so boolean context works, just not string
23​:35 <@​jnthn> *nod*
23​:35 <@​jnthn> Ah, I remember now...I didn't fix the "list of methods" return part of it 'cus lists were still in flux at that point.
23​:35 <@​jnthn> And didn't get to re-visit it since.
23​:36 <@​jnthn> ETOOMUCHTODO
23​:36 <@​au|irc> it's ok. *writes to rakudobug@​perl.org*

@p6rt
Copy link
Author

p6rt commented Jul 29, 2010

@coke - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Sep 23, 2010

From @ashgti

$ perl6

class A { method a { 1 } }; A.can('a');
===SORRY!===
get_string() not implemented in class 'P6Invocation'

It happens whenever you try to Stringify the result of .can, .can is
probably returning something primitive in parrot.

@p6rt
Copy link
Author

p6rt commented Oct 8, 2011

From @coke

On Wed Sep 22 19​:09​:19 2010, ash_gti wrote​:

$ perl6

class A { method a { 1 } }; A.can('a');
===SORRY!===
get_string() not implemented in class 'P6Invocation'

It happens whenever you try to Stringify the result of .can, .can is
probably returning something primitive in parrot.

Fixed​:

16​:15 < [Coke]> rakudo​: class C { method M {} }; say C.new.can('M');
16​:15 <+p6eval> rakudo 88c5a5​: OUTPUT«M␤»
16​:16 < [Coke]> rakudo​: class A { method a { 1 } }; A.can('a').say;
16​:16 <+p6eval> rakudo 88c5a5​: OUTPUT«a␤»

Closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 6, 2012

From @moritz

now tested in S12-introspection/can.t

@p6rt
Copy link
Author

p6rt commented Jan 6, 2012

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

@p6rt p6rt closed this as completed Jan 6, 2012
@p6rt p6rt added the testneeded label Jan 5, 2020
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