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

can not augment List class #3127

Closed
p6rt opened this issue May 9, 2013 · 6 comments
Closed

can not augment List class #3127

p6rt opened this issue May 9, 2013 · 6 comments

Comments

@p6rt
Copy link

p6rt commented May 9, 2013

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

Searchable as RT117923$

@p6rt
Copy link
Author

p6rt commented May 9, 2013

From @grondilu

This is perl6 version 2013.04-55-gfe70494 built on parrot 5.2.0
revision RELEASE_5_2_0

use MONKEY_TYPING;
augment class List { proto method combinations(|) {*} }

Cannot look up attributes in a type object
current instr.​: 'gimme' pc 285305 (src/gen/CORE.setting.pir​:125270) (src/gen/CORE.setting​:6051)
called from Sub 'sink' pc 294412 (src/gen/CORE.setting.pir​:128913) (src/gen/CORE.setting​:6359)
called from Sub 'MAIN' pc 381 (src/gen/perl6.pir​:147) (src/main.nqp src/gen/main-version.nqp​:42)
called from Sub '' pc 77 (src/gen/perl6.pir​:56) (src/main.nqp src/gen/main-version.nqp​:1)
called from Sub '' pc 1127 (src/gen/perl6.pir​:404) (src/main.nqp src/gen/main-version.nqp​:52)

@p6rt
Copy link
Author

p6rt commented May 11, 2013

From @pmichaud

On Wed May 08 18​:16​:40 2013, grondilu@​yahoo.fr wrote​:

This is perl6 version 2013.04-55-gfe70494 built on parrot 5.2.0
revision RELEASE_5_2_0

use MONKEY_TYPING;
augment class List { proto method combinations(|) {*} }

Cannot look up attributes in a type object

It works for me if I put a statement after the augment​:

  pmichaud@​kiwi​:~/p6/rakudo$ cat x.p6
  use MONKEY_TYPING;
  augment class List {
  proto method combinations(|) { * }
  }
 
  say 1;
  pmichaud@​kiwi​:~/p6/rakudo$ ./perl6 x.p6
  1

I suspect the problem is that as the last statement in the block,
the augmented class is being returned to MAIN or some other
top-level routine which is then trying to do something with
it (such as convert it to an integer exit code).

I can get the same error as the original ticket without using "augment"​:

  pmichaud@​kiwi​:~/p6/rakudo$ cat y.p6
  use v6;
 
  List;
 
  pmichaud@​kiwi​:~/p6/rakudo$ ./perl6 y.p6
  Cannot look up attributes in a type object
  current instr.​: 'gimme' pc 285293 (src/gen/CORE.setting.pir​:125268)
(src/gen/CORE.setting​:6051)
  called from Sub 'sink' pc 294400 (src/gen/CORE.setting.pir​:128911)
(src/gen/CORE.setting​:6359)
  called from Sub 'MAIN' pc 381 (src/gen/perl6.pir​:147) (src/main.nqp
src/gen/main-version.nqp​:42)
  called from Sub '' pc 77 (src/gen/perl6.pir​:56) (src/main.nqp
src/gen/main-version.nqp​:1)
  called from Sub '' pc 1127 (src/gen/perl6.pir​:404) (src/main.nqp
src/gen/main-version.nqp​:52)
  pmichaud@​kiwi​:~/p6/rakudo$

@p6rt
Copy link
Author

p6rt commented May 11, 2013

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

@p6rt
Copy link
Author

p6rt commented May 11, 2013

From @pmichaud

Now fixed in b1695cf​:

pmichaud@​kiwi​:~/p6/rakudo$ cat x.p6
use MONKEY_TYPING;
augment class List {
  proto method combinations(|) { * }
}

pmichaud@​kiwi​:~/p6/rakudo$ ./perl6 x.p6
pmichaud@​kiwi​:~/p6/rakudo$

Ticket closable with tests (hint​: test that List.sink doesn't fail).

Pm

@p6rt
Copy link
Author

p6rt commented May 11, 2013

From @coke

On Sat May 11 11​:18​:58 2013, pmichaud wrote​:

Now fixed in b1695cf​:

pmichaud@​kiwi​:~/p6/rakudo$ cat x.p6
use MONKEY_TYPING;
augment class List {
proto method combinations(|) { * }
}

pmichaud@​kiwi​:~/p6/rakudo$ ./perl6 x.p6
pmichaud@​kiwi​:~/p6/rakudo$

Ticket closable with tests (hint​: test that List.sink doesn't fail).

Pm

Link.sink test added; closing ticket.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented May 11, 2013

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

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