Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement classes with enclosing superclasses
  • Loading branch information
sorear committed Oct 23, 2010
1 parent 87a15a5 commit e2b18ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/Metamodel.pm
Expand Up @@ -178,7 +178,7 @@ our %units;
}

sub close {
my ($self, $targ) = @_;
my ($self) = @_;
if ($self->name ne 'Mu' && $unit->is_true_setting
&& !@{ $self->superclasses }) {
$self->add_super($unit->get_stash_obj(
Expand All @@ -188,7 +188,9 @@ our %units;
my @merge;
push @merge, [ $self->xref, @{ $self->superclasses } ];
for (@{ $self->superclasses }) {
push @merge, [ @{ $unit->deref($_)->linearized_mro } ];
my $d = $unit->deref($_);
$d->close unless $d->linearized_mro;
push @merge, [ @{ $d->linearized_mro } ];
}
my @mro;
my %used;
Expand Down Expand Up @@ -1047,10 +1049,10 @@ sub Op::PackageDef::begin {
$opensubs[-1]->add_pkg_exports($unit, $self->var, [ @ns, $n ], $self->exports);
if (!$self->stub) {
my $obj = $pclass->new(name => $self->name)->xref;
$unit->get_stash(@ns)->bind_name($n, $obj);
my $body = $self->body->begin(body_of => $obj, cur_pkg => [ @ns, $n ],
once => ($pclass ne 'Metamodel::ParametricRole'));
$unit->deref($obj)->close;
$unit->get_stash(@ns)->bind_name($n, $obj);
$opensubs[-1]->add_exports($unit, $self->var, $obj, $self->exports);

if ($pclass eq 'Metamodel::ParametricRole') {
Expand Down
4 changes: 0 additions & 4 deletions src/Niecza/Actions.pm
Expand Up @@ -744,10 +744,6 @@ sub do_cclass { my ($cl, $M) = @_;
}

sub decapturize { my ($cl, $M) = @_;
if ($M->{assertion}{assertion}[0]) {
$M->sorry("Binding to a method doesn't work like that");
return;
}
if (!$M->{assertion}{_ast}->isa('RxOp::Subrule')) {
return $M->{assertion}{_ast};
}
Expand Down

0 comments on commit e2b18ba

Please sign in to comment.