Permalink
Browse files

check lexical before package name

our $i; { my $i; { $i }} incorrectly did not mark usage of lexical $i,
resulting in spurious warning.
  • Loading branch information...
TimToady committed Sep 1, 2012
1 parent 4f02273 commit 1748dc5eb356fa222f47b9b3865100e254791f59
Showing with 4 additions and 4 deletions.
  1. +4 −4 STD.pm6
View
@@ -5803,8 +5803,11 @@ method is_known ($n, $curlex = $*CURLEX) {
my $name = $n;
self.deb("is_known $name") if $*DEBUG +& DEBUG::symtab;
return True if $*QUASIMODO;
- return True if $*CURPKG.{$name};
return False if $name ~~ /\:\:\(/;
+
+ my $varbind = { truename => '???' };
+ return True if $n !~~ /\:\:/ and self.lex_can_find_name($curlex,$name,$varbind);
+
my $curpkg = $*CURPKG;
my @components = self.canonicalize_name($name);
if @components > 1 {
@@ -5845,10 +5848,7 @@ method is_known ($n, $curlex = $*CURLEX) {
# leading components take us non-lexical? assume we can't know
return False if $curpkg !=== $*CURPKG and $curpkg<!id>[0] ~~ /^GLOBAL($|\:\:)/;
- my $varbind = { truename => '???' };
- return True if $n !~~ /\:\:/ and self.lex_can_find_name($curlex,$name,$varbind);
self.deb("Not Found") if $*DEBUG +& DEBUG::symtab;
-
return False;
}

0 comments on commit 1748dc5

Please sign in to comment.