Skip to content

Commit 3cb1917

Browse files
committed
Make sure that the PAST compiler can get at the actual type object for an attribute's class.
1 parent 1b3034b commit 3cb1917

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/NQP/Actions.pm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,14 @@ class NQP::Actions is HLL::Actions {
455455
elsif $<twigil>[0] eq '!' {
456456
# Construct PAST.
457457
my $name := ~@name.pop;
458+
my $ch := PAST::Var.new( :name('$?CLASS') );
459+
$ch<has_compile_time_value> := 1;
460+
$ch<compile_time_value> := $*PACKAGE;
458461
$past := PAST::Var.new(
459462
:name($name), :scope('attribute_6model'),
460463
:viviself( vivitype( $<sigil> ) ),
461464
PAST::Op.new( :pirop('nqp_decontainerize PP'), PAST::Var.new( :name('self') ) ),
462-
PAST::Var.new( :name('$?CLASS') )
465+
$ch
463466
);
464467

465468
# Make sure the attribute exists and add type info.

0 commit comments

Comments
 (0)