Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Elide many lexicalref/attributeref takes.
  • Loading branch information
jnthn committed Feb 28, 2015
1 parent b7388c6 commit 40d219c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/vm/jvm/QAST/Compiler.nqp
Expand Up @@ -4163,6 +4163,15 @@ class QAST::CompilerJAST {
nqp::die("No scope specified or locatable in the symbol table for '$name'");
}
}

# Both lexicalref and attributeref in the context we want a
# non-object devolve to lexical and attribute, since we'd only
# de-ref right away anyway.
my $want := $*WANT;
if nqp::defined($want) && $want != $RT_OBJ {
$scope := 'lexical' if $scope eq 'lexicalref';
$scope := 'attribute' if $scope eq 'attributeref';
}

# Now go by scope.
if $scope eq 'local' {
Expand Down

0 comments on commit 40d219c

Please sign in to comment.