Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
two enum fixups, jnthn++ JimmyZ++
  • Loading branch information
moritz committed May 12, 2012
1 parent f48c49d commit f72c306
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Perl6/Actions.pm
Expand Up @@ -2372,7 +2372,7 @@ class Perl6::Actions is HLL::Actions {
}
}
# create a type object even for empty enums
make_type_obj unless $has_base_type;
make_type_obj($*W.find_symbol(['Int'])) unless $has_base_type;

$*W.install_package($/, $longname.type_name_parts('enum name', :decl(1)),
($*SCOPE || 'our'), 'enum', $*PACKAGE, $*W.cur_lexpad(), $type_obj);
Expand Down
3 changes: 2 additions & 1 deletion src/Perl6/World.pm
Expand Up @@ -1214,8 +1214,9 @@ class Perl6::World is HLL::World {
# Adds a value to an enumeration.
method create_enum_value($enum_type_obj, $key, $value) {
# Create directly.
my $val := pir::repr_change_type__0PP(pir::repr_clone__PP($value), $enum_type_obj);
my $val := pir::repr_change_type__0PP(pir::repr_clone__PP($value), $enum_type_obj);
nqp::bindattr($val, $enum_type_obj, '$!key', $key);
nqp::bindattr($val, $enum_type_obj, '$!value', $value);
self.add_object($val);

# Add to meta-object.
Expand Down

0 comments on commit f72c306

Please sign in to comment.