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

.perl on Attribute does not work with LTA error message #2033

Closed
p6rt opened this issue Aug 7, 2010 · 9 comments
Closed

.perl on Attribute does not work with LTA error message #2033

p6rt opened this issue Aug 7, 2010 · 9 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 7, 2010

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

Searchable as RT77070$

@p6rt
Copy link
Author

p6rt commented Aug 7, 2010

From sohtil@gmail.com

Hi!

Calling .perl on an Attribute gives me a confusing error message​:

Method 'attributes' not found for invocant of class ''
  in 'Mu​::attribs' at line 1198​:CORE.setting
  in 'Mu​::perl' at line 1207​:CORE.setting
  in main program body at line 7​:test.pl

Lithos

This is Rakudo Perl 6, version 2010.07-84-g0e5edb5 built on parrot 2.6.0 r48225

$ cat test.pl
use v6;

my $attr = Int.^methods.first({.name eq <new>}).^attributes.[0];

say $attr.WHAT;
say $attr.name;
say $attr.perl;

@p6rt
Copy link
Author

p6rt commented Feb 1, 2012

From @coke

On Sat Aug 07 04​:40​:57 2010, lithos wrote​:

Hi!

Calling .perl on an Attribute gives me a confusing error message​:

Method 'attributes' not found for invocant of class ''
in 'Mu​::attribs' at line 1198​:CORE.setting
in 'Mu​::perl' at line 1207​:CORE.setting
in main program body at line 7​:test.pl

Lithos

This is Rakudo Perl 6, version 2010.07-84-g0e5edb5 built on parrot
2.6.0 r48225

$ cat test.pl
use v6;

my $attr = Int.^methods.first({.name eq <new>}).^attributes.[0];

say $attr.WHAT;
say $attr.name;
say $attr.perl;

Instead of a confusing error message, we now segfault.

Here's the beginning of the stacktrace​:

#​0 0xf63d9f4d in Rakudo_cont_decontainerize () from dynext/perl6_ops.so
#​1 0xf63d86ad in find_in_cache () from dynext/perl6_ops.so
#​2 0xf63d9967 in Rakudo_md_dispatch () from dynext/perl6_ops.so
#​3 0xf7dbbf25 in Parrot_MDThunk_invoke () from dynext/perl6_group.so
#​4 0xf7e0945f in Parrot_invokecc_p ()
  from /home/coke/sandbox/perl6pass/rakudo/install/lib/libparrot.so.4.0.0
#​5 0xf7e5ae8c in runops_fast_core ()
  from /home/coke/sandbox/perl6pass/rakudo/install/lib/libparrot.so.4.0.0
#​6 0xf7e5aaa8 in runops_int ()
  from /home/coke/sandbox/perl6pass/rakudo/install/lib/libparrot.so.4.0.0
#​7 0xf7e41206 in runops ()

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Feb 1, 2012

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

@p6rt
Copy link
Author

p6rt commented Nov 16, 2012

From @coke

On Sat Aug 07 04​:40​:57 2010, lithos wrote​:

Hi!

Calling .perl on an Attribute gives me a confusing error message​:

Method 'attributes' not found for invocant of class ''
in 'Mu​::attribs' at line 1198​:CORE.setting
in 'Mu​::perl' at line 1207​:CORE.setting
in main program body at line 7​:test.pl

Lithos

This is Rakudo Perl 6, version 2010.07-84-g0e5edb5 built on parrot
2.6.0 r48225

$ cat test.pl
use v6;

my $attr = Int.^methods.first({.name eq <new>}).^attributes.[0];

say $attr.WHAT;
say $attr.name;
say $attr.perl;

$ ./perl6 test.pl
Attribute()
$!exception
Attribute.new()

Closable with tests.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 15, 2014

From @coke

On Thu Nov 15 20​:41​:24 2012, coke wrote​:

On Sat Aug 07 04​:40​:57 2010, lithos wrote​:

Hi!

Calling .perl on an Attribute gives me a confusing error message​:

Method 'attributes' not found for invocant of class ''
in 'Mu​::attribs' at line 1198​:CORE.setting
in 'Mu​::perl' at line 1207​:CORE.setting
in main program body at line 7​:test.pl

Lithos

This is Rakudo Perl 6, version 2010.07-84-g0e5edb5 built on parrot
2.6.0 r48225

$ cat test.pl
use v6;

my $attr = Int.^methods.first({.name eq <new>}).^attributes.[0];

say $attr.WHAT;
say $attr.name;
say $attr.perl;

$ ./perl6 test.pl
Attribute()
$!exception
Attribute.new()

Closable with tests.

Bitrotted, needs fixing again​:

$ ./perl6 test.pl
(Any)
No such method 'name' for invocant of type 'Any'
  in block at test.pl​:6

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 13, 2014

From @usev6

Looks like Int.^methods doesn't contain the method "new" and therefore $attr ends up empty.

$ perl6-m -e 'Int.^methods.say'
Int Num Rat FatRat abs Bridge chr sqrt base expmod is-prime floor ceiling round lsb msb narrow Range sign conj rand sin asin cos acos tan atan atan2 sec asec cosec acosec cotan acotan sinh asinh cosh acosh tanh atanh sech asech cosech acosech cotanh acotanh unpolar cis Complex log exp truncate isNaN Real log10 roots succ pred sleep WHICH perl Bool Str Numeric ACCEPTS gist DUMP
$ perl6-m -e 'Int.^methods.first({.name eq <new>}).WHAT.say'
Nil
$ perl6-m -e 'my $attr = Int.^methods.first({.name eq <new>}).^attributes.[0]; $attr.WHAT.say'
(Mu)

@p6rt
Copy link
Author

p6rt commented Sep 1, 2016

From @MasterDuke17

On Mon Oct 13 14​:12​:09 2014, bartolin@​gmx.de wrote​:

Looks like Int.^methods doesn't contain the method "new" and therefore
$attr ends up empty.

$ perl6-m -e 'Int.^methods.say'
Int Num Rat FatRat abs Bridge chr sqrt base expmod is-prime floor
ceiling round lsb msb narrow Range sign conj rand sin asin cos acos
tan atan atan2 sec asec cosec acosec cotan acotan sinh asinh cosh
acosh tanh atanh sech asech cosech acosech cotanh acotanh unpolar cis
Complex log exp truncate isNaN Real log10 roots succ pred sleep WHICH
perl Bool Str Numeric ACCEPTS gist DUMP
$ perl6-m -e 'Int.^methods.first({.name eq <new>}).WHAT.say'
Nil
$ perl6-m -e 'my $attr = Int.^methods.first({.name eq
<new>}).^attributes.[0]; $attr.WHAT.say'
(Mu)

perl6 -e 'Int.^methods.say'
(Int Num Rat FatRat abs Bridge chr sqrt base polymod expmod is-prime floor ceiling round lsb msb narrow Range sign sin tan cotan acosech conj atan2 cosec pred asec acotan cosh acos acosec sech unpolar log10 atanh log exp acosh truncate sinh tanh acotanh Real sec isNaN succ rand asin cos cis cosech asech roots Complex cotanh asinh atan WHICH new perl Bool Str gist ACCEPTS DUMP Numeric)

perl6 -e 'Int.^methods.first({.name eq <new>}).WHAT.say'
(Method)

perl6 -e 'Int.^methods.first({.name eq <new>}).^attributes.say'
Method 'gist' not found for invocant of class 'BOOTSTRAPATTR'
  in block <unit> at -e line 1

perl6 -e 'Int.^methods.first({.name eq <new>}).^attributes.[0].say'
Method 'say' not found for invocant of class 'BOOTSTRAPATTR'
  in block <unit> at -e line 1

perl6 --version
This is Rakudo version 2016.08.1-59-gec9e814 built on MoarVM version 2016.08-23-gfa9528b
implementing Perl 6.c.

@p6rt
Copy link
Author

p6rt commented Dec 10, 2016

From @MasterDuke17

Fixed in rakudo/rakudo@3dd2916
Tests added in Raku/roast@31ce7c1221

@p6rt
Copy link
Author

p6rt commented Dec 10, 2016

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

@p6rt p6rt closed this as completed Dec 10, 2016
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant