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 push non-X objects to an attribute array typed with X in Rakudo #2733

Closed
p6rt opened this issue Apr 28, 2012 · 8 comments
Closed

Can push non-X objects to an attribute array typed with X in Rakudo #2733

p6rt opened this issue Apr 28, 2012 · 8 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Apr 28, 2012

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

Searchable as RT112660$

@p6rt
Copy link
Author

p6rt commented Apr 28, 2012

From @masak

<gfldex> r​: https://gist.github.com/2518066
<p6eval> rakudo a25e7d​: OUTPUT«Null PMC access in find_method('slots') [...]
<jnthn> Eek. That looks bad.
<moritz> @​.slots.push([$sender, $rcpt, $method]);
<moritz> that shouldn't ever work
<moritz> because @​!slots is typed to contain Method objects
<moritz> and you try to push an array on it
<jnthn> Wow, yes.
<moritz> r​: class A { has Method @​.slots; }; A.new.slots.push​: [1, 2, 3]
<p6eval> rakudo a25e7d​: ( no output )
<moritz> masak​: wanna submit?
* masak submits rakudobug
<gfldex> changed Method @​.slots to just @​.slots, still Null PMC
<masak> gfldex​: right, that's not the cause of the Null PMC access. we
know this.
<masak> ;)
<masak> just finding different, easier errors on the way.

@p6rt
Copy link
Author

p6rt commented Apr 28, 2012

From @coke

Adding contents of gist as an attachment on the ticket.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Apr 28, 2012

From @coke

112660.p6

@p6rt
Copy link
Author

p6rt commented Apr 28, 2012

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

@p6rt
Copy link
Author

p6rt commented May 30, 2012

From @diakopter

On Sat Apr 28 04​:28​:00 2012, masak wrote​:

<gfldex> r​: https://gist.github.com/2518066
<p6eval> rakudo a25e7d​: OUTPUT�Null PMC access in
find_method('slots') [...]
<jnthn> Eek. That looks bad.
<moritz> @​.slots.push([$sender, $rcpt, $method]);
<moritz> that shouldn't ever work
<moritz> because @​!slots is typed to contain Method objects
<moritz> and you try to push an array on it
<jnthn> Wow, yes.
<moritz> r​: class A { has Method @​.slots; }; A.new.slots.push​: [1, 2,
3]
<p6eval> rakudo a25e7d​: ( no output )
<moritz> masak​: wanna submit?
* masak submits rakudobug
<gfldex> changed Method @​.slots to just @​.slots, still Null PMC
<masak> gfldex​: right, that's not the cause of the Null PMC access. we
know this.
<masak> ;)
<masak> just finding different, easier errors on the way.

doesn't NPA anymore, but has this error​:

19​:37 <diakopter> r​: https://gist.github.com/2831711
19​:37 <p6eval> rakudo 024843​: OUTPUT«Button()App()Method()␤Too many
positional parameters
  passed; got 2 but expected 1␤ in method exit at
/tmp/dm3wfSpvKW​:39␤ in sub
  handle_call at /tmp/dm3wfSpvKW​:23␤ in any enter at
  src/gen/Metamodel.pm​:2697␤ in method postcircumfix​:<(
)> at
  src/gen/CORE.setting​:1…

@p6rt
Copy link
Author

p6rt commented Jul 3, 2015

From @usev6

AFAIU this ticket is about the type of @​.slots not being respected. This seems to be fixed now​:

$ perl6 -e 'class A { has Method @​.slots; }; A.new.slots.push​: [1, 2, 3]'
Type check failed in assignment to '@​!slots'; expected 'Method' but got 'Array'
  in block <unit> at -e​:1

I added a test to S32-array/push.t with commit Raku/roast@d466fc79bb.

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jul 3, 2015

From @usev6

AFAIU this ticket is about the type of @​.slots not being respected. This seems to be fixed now​:

$ perl6 -e 'class A { has Method @​.slots; }; A.new.slots.push​: [1, 2, 3]'
Type check failed in assignment to '@​!slots'; expected 'Method' but got 'Array'
  in block <unit> at -e​:1

I added a test to S32-array/push.t with commit Raku/roast@d466fc79bb.

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Jul 3, 2015

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

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