Илья (>):
> I use role to mix in some functionality for testing:
>
> my $s = November::Storage::File.new does Testing;
>
> And I have Role definition _after_ this:
>
> role Testing { ... }
>
> Now this is fall with:
>
> Null PMC access in isa()
> current instr.: 'infix:does' pc 20660 (src/builtins/op.pir:403)
> called from Sub '_block14' pc 108 (EVAL_20:47)
>
> And all work again if I put definition _before_ instant and `does`.
>
> It looks like bug for my, but mb this is right behaviour?

The 'Null PMC access' certainly isn't right, but even modulo that, the
role must be declared before it's being used. Jonathan said that it
should really be a compile error.

 <http://irclog.perlgeek.de/perl6/2009-01-18#i_843003>

Generally, in Perl 6, one has to declare identifiers in some way
before referring to them.

// Carl

Reply via email to