Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make sure we also emit a call to trait_mod:<is>($class, :hidden), eve…
…n though it also has some compiler side-effects (like suppressing *%_).
  • Loading branch information
jnthn committed Aug 14, 2009
1 parent 1a5c5f3 commit 637d803
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/classes/ClassHOW.pir
Expand Up @@ -474,7 +474,8 @@ Accessor for hidden property.
.sub 'hidden' :method
$P0 = getattribute self, '$!hidden'
unless null $P0 goto done
$P0 = new ['Perl6Scalar']
$P0 = get_hll_global ['Bool'], 'False'
$P0 = new ['Perl6Scalar'], $P0
setattribute self, '$!hidden', $P0
done:
.return ($P0)
Expand Down
6 changes: 4 additions & 2 deletions src/parser/actions.pm
Expand Up @@ -1610,9 +1610,11 @@ method package_def($/, $key) {
# Set is also flag.
$block<isalso> := has_compiler_trait_with_val($<trait>, 'trait_mod:is', 'also');

# Emit traits; make sure rw and hidden, if given, were marked as handled first.
# Emit traits; make sure rw always is marked as compiler handled and hidden is
# always emitted even though we also have somewhat handled it in the compiler.
has_compiler_trait_with_val($<trait>, 'trait_mod:is', 'rw');
has_compiler_trait_with_val($<trait>, 'trait_mod:is', 'hidden');
my $hidden := has_compiler_trait_with_val($<trait>, 'trait_mod:is', 'hidden');
if $hidden { $hidden<trait_is_compiler_handled> := 0 }
emit_traits($<trait>, $init, $?METACLASS);

# If it's not an "is also", have a name and aren't a role (since they can
Expand Down

0 comments on commit 637d803

Please sign in to comment.