Skip Menu |
Report information
Id: 109734
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] Strange MOP type check cache error message when doing <at_pos(1)> in a regex in Rakudo
Date: Fri, 3 Feb 2012 14:06:54 +0100
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 1.7k
<masak> how would you split a string into the first character and the rest of the string in Perl 6? <moritz> .split(/<at_pos(1)>/) <jnthn> ooh <moritz> nom: say 'foobar'.split(/<at_pos(1)>/).perl <p6eval> nom acbec8: OUTPUT«No type check cache and no type_check method in meta-object␤ in method reify [...] <jnthn> How in the hell... <moritz> jnthn: indeed. <moritz> I get the same output locally * masak submits rakudobug <jnthn> OK, what is at_pos doing... :) <jnthn> Wild guess: using nqp::getattr somewhere it should be using nqp::getattr_i :) <moritz> erm, is it even spelled at_pos? <moritz> I might as well be misremembering something <masak> at the very least, it's an LTA error message. <p6eval> nom acbec8: OUTPUT«=> <>␤ at => <>␤␤» <moritz> star: say 'foobar'.split(/<at(1)>/).perl <p6eval> star 2012.01: OUTPUT«("f", "oobar").list␤» <masak> \o/ <moritz> ok, it helps to spell it correctly :-) <jnthn> \o/ <masak> so, error is in using something that doesn't exist :) <masak> typical "programmer never tried this path" thinko :) <jnthn> nom: say Any.^methods <p6eval> nom acbec8: OUTPUT«eager elems end classify uniq infinite flat hash list pick roll reverse sort values keys kv pairs Array grep first join map min max minmax postcircumfix:<[ ]> at_pos all any one none postcircumfix:<{ }> reduce ACCEPTS␤» <masak> oh! <moritz> well, at_pos comes from Any <jnthn> There's an at_pos in Any <masak> right. <masak> so it does something completely different. <moritz> yes. <masak> and the regex engine gets sad. <jnthn> And doesn't return a cursor which...yes, that. :) <masak> I will report this as best I can :P So, at_pos returns something which the regex engine didn't expect, and instead of failing gracefully, it fails disgracefully. Please fix.
Checked on what the current behavior is: $ perl6 -e 'say "foobar".split(/<at_pos(1)>/).perl' Method 'at_pos' not found for invocant of class 'Cursor' in block <unit> at -e line 1 ...so for actually unknown methods the error message is fine. (AT-POS now) However, the error for known but not cursor-returning methods is still LTA, though different: $ perl6 -e 'say "foobar".split(/<AT-POS(1)>/).perl' P6opaque: no such attribute '$!pos' in block <unit> at -e line 1 $ perl6 -e 'say "foobar".split(/<Bool>/).perl' P6opaque: no such attribute '$!pos' in block <unit> at -e line 1 $ perl6 -e 'say "foobar".split(/<pos>/).perl' P6opaque: no such attribute '$!pos' in block <unit> at -e line 1 $ perl6 -e 'say "foobar".split(/<prune>/).perl' Cannot look up attributes in a type object in block <unit> at -e line 1 $ perl6 -e 'say "foobar".split(/<from>/).perl' P6opaque: no such attribute '$!pos' in block <unit> at -e line 1 $ perl6 -e 'say "foobar".split(/<target>/).perl' P6opaque: no such attribute '$!pos' in block <unit> at -e line 1


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org