Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix up REQUIRE_IMPORT
now it works, except that it currently imports our-symbols and not exported symbols
  • Loading branch information
moritz committed Jun 10, 2012
1 parent 60a9808 commit 200af35
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/core/operators.pm
Expand Up @@ -269,18 +269,17 @@ sub INDIRECT_NAME_LOOKUP($root, *@chunks) is rw {
}

sub REQUIRE_IMPORT($package-name, *@syms) {
my $package := OUR::{$package-name}.WHO;
my $package := CALLER::OUR::{$package-name}.WHO;
my @missing;
for @syms {
if $package.exists($_) {
CALLER::{$_} := $package{$_};
}
else {
unless $package.exists($_) {
@missing.push: $_;
next;
}
OUTER::CALLER::{$_} := $package{$_};
}
if @missing {
X::Import::MissingSymbols.new(:from($package-name), :@missing).throw;
}
OUR::{$package-name};
CALLER::OUR::{$package-name};
}

0 comments on commit 200af35

Please sign in to comment.