Skip to content

Commit

Permalink
Use nqp::setwho and nqp::newtype.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Jun 21, 2012
1 parent 46cf8f8 commit bc64ed0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
4 changes: 1 addition & 3 deletions src/how/NQPClassHOW.pm
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ knowhow NQPClassHOW {
# to go with it, and return that.
method new_type(:$name = '<anon>', :$repr = 'P6opaque') {
my $metaclass := self.new(:name($name));
pir::set_who__0PP(
pir::repr_type_object_for__PPS($metaclass, $repr),
{});
nqp::setwho(nqp::newtype($metaclass, $repr), {});
}

method add_method($obj, $name, $code_obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/how/NQPConcreteRoleHOW.pm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ knowhow NQPConcreteRoleHOW {
# to go with it, and return that.
method new_type(:$name = '<anon>', :$instance_of!) {
my $metarole := self.new(:name($name), :instance_of($instance_of));
pir::repr_type_object_for__PPS($metarole, 'Uninstantiable');
nqp::newtype($metarole, 'Uninstantiable');
}

method add_method($obj, $name, $code_obj) {
Expand Down
4 changes: 1 addition & 3 deletions src/how/NQPModuleHOW.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ knowhow NQPModuleHOW {
# to go with it, and return that.
method new_type(:$name = '<anon>') {
my $metaclass := self.new(:name($name));
pir::set_who__0PP(
pir::repr_type_object_for__PPS($metaclass, 'Uninstantiable'),
{});
nqp::setwho(nqp::newtype($metaclass, 'Uninstantiable'), {});
}

method add_method($obj, $name, $code_obj) {
Expand Down
4 changes: 1 addition & 3 deletions src/how/NQPNativeHOW.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ knowhow NQPNativeHOW {
# XXX Should check that this is an inlineable REPR.
method new_type(:$name = '<anon>', :$repr!) {
my $metaclass := self.new(:name($name));
pir::set_who__0PP(
pir::repr_type_object_for__PPS($metaclass, $repr),
{});
nqp::setwho(nqp::newtype($metaclass, $repr), {});
}

method add_method($obj, $name, $code_obj) {
Expand Down
4 changes: 1 addition & 3 deletions src/how/NQPParametricRoleHOW.pm
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ knowhow NQPParametricRoleHOW {
# to go with it, and return that.
method new_type(:$name = '<anon>') {
my $metarole := self.new(:name($name));
pir::set_who__0PP(
pir::repr_type_object_for__PPS($metarole, 'Uninstantiable'),
{});
nqp::setwho(nqp::newtype($metarole, 'Uninstantiable'), {});
}

method set_body_block($obj, $body_block) {
Expand Down

0 comments on commit bc64ed0

Please sign in to comment.