Navigation Menu

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

Null PMC access when calling method on proto-object on imported role, when the method has a parameter with another role as a type #693

Closed
p6rt opened this issue Feb 12, 2009 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Feb 12, 2009

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

Searchable as RT63170$

@p6rt
Copy link
Author

p6rt commented Feb 12, 2009

From @masak

In Rakudo b2e7ac, Parrot r36619​:

$ cat A.pm
use v6;
role A { method x(B $b) {} }
$ perl6 -e 'role B {}; use A; A.x(B)'
Null PMC access in isa()
[...]

Observations​:

* The role A must be imported for this to happen.
* The parameter in method x must refer to B.
* The argument to A.x doesn't actually have to be B, or of type B. The
error occurs anyway.

@p6rt
Copy link
Author

p6rt commented Mar 20, 2009

From @jnthn

On Thu Feb 12 01​:22​:34 2009, masak wrote​:

In Rakudo b2e7ac, Parrot r36619​:

$ cat A.pm
use v6;
role A { method x(B $b) {} }
$ perl6 -e 'role B {}; use A; A.x(B)'
Null PMC access in isa()
[...]

Observations​:

* The role A must be imported for this to happen.
* The parameter in method x must refer to B.
* The argument to A.x doesn't actually have to be B, or of type B. The
error occurs anyway.

Note that this should never "work" because of separate compilation. If
you pre-compiled A.pm it would fail telling you that you had a malformed
declaration (because type B did not exist). We just didn't give the
compiler a clean enough set of state so it thought B was acceptable, and
generated something that barfed at runtime instead.

Anyway, in git 703b36e I've now made sure we give a clean @​?BLOCK to the
recursive call into the compiler in a use, which means we fail at
compile time now, as we should.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Mar 20, 2009

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

@p6rt
Copy link
Author

p6rt commented Mar 20, 2009

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

@p6rt p6rt closed this as completed Mar 20, 2009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant