Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use Uninstantiable repr for things that should not be instantiated.
  • Loading branch information
jnthn committed Jul 5, 2011
1 parent a957601 commit 2d4a979
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/how/NQPConcreteRoleHOW.pm
Expand Up @@ -45,9 +45,9 @@ knowhow NQPConcreteRoleHOW {

# Create a new meta-object instance, and then a new type object
# to go with it, and return that.
method new_type(:$name = '<anon>', :$repr = 'P6opaque', :$instance_of!) {
method new_type(:$name = '<anon>', :$instance_of!) {
my $metarole := self.new(:name($name), :instance_of($instance_of));
pir::repr_type_object_for__PPS($metarole, $repr);
pir::repr_type_object_for__PPS($metarole, 'Uninstantiable');
}

method add_method($obj, $name, $code_obj) {
Expand Down
4 changes: 2 additions & 2 deletions src/how/NQPModuleHOW.pm
Expand Up @@ -14,10 +14,10 @@ knowhow NQPModuleHOW {

# Create a new meta-class instance, and then a new type object
# to go with it, and return that.
method new_type(:$name = '<anon>', :$repr = 'P6opaque') {
method new_type(:$name = '<anon>') {
my $metaclass := self.new(:name($name));
pir::set_who__0PP(
pir::repr_type_object_for__PPS($metaclass, $repr),
pir::repr_type_object_for__PPS($metaclass, 'Uninstantiable'),
{});
}

Expand Down
4 changes: 2 additions & 2 deletions src/how/NQPParametricRoleHOW.pm
Expand Up @@ -44,10 +44,10 @@ knowhow NQPParametricRoleHOW {

# Create a new meta-class instance, and then a new type object
# to go with it, and return that.
method new_type(:$name = '<anon>', :$repr = 'P6opaque') {
method new_type(:$name = '<anon>') {
my $metarole := self.new(:name($name));
pir::set_who__0PP(
pir::repr_type_object_for__PPS($metarole, $repr),
pir::repr_type_object_for__PPS($metarole, 'Uninstantiable'),
{});
}

Expand Down

0 comments on commit 2d4a979

Please sign in to comment.