Skip to content

Commit 1748dc5

Browse files
committed
check lexical before package name
our $i; { my $i; { $i }} incorrectly did not mark usage of lexical $i, resulting in spurious warning.
1 parent 4f02273 commit 1748dc5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

STD.pm6

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5803,8 +5803,11 @@ method is_known ($n, $curlex = $*CURLEX) {
58035803
my $name = $n;
58045804
self.deb("is_known $name") if $*DEBUG +& DEBUG::symtab;
58055805
return True if $*QUASIMODO;
5806-
return True if $*CURPKG.{$name};
58075806
return False if $name ~~ /\:\:\(/;
5807+
5808+
my $varbind = { truename => '???' };
5809+
return True if $n !~~ /\:\:/ and self.lex_can_find_name($curlex,$name,$varbind);
5810+
58085811
my $curpkg = $*CURPKG;
58095812
my @components = self.canonicalize_name($name);
58105813
if @components > 1 {
@@ -5845,10 +5848,7 @@ method is_known ($n, $curlex = $*CURLEX) {
58455848
# leading components take us non-lexical? assume we can't know
58465849
return False if $curpkg !=== $*CURPKG and $curpkg<!id>[0] ~~ /^GLOBAL($|\:\:)/;
58475850

5848-
my $varbind = { truename => '???' };
5849-
return True if $n !~~ /\:\:/ and self.lex_can_find_name($curlex,$name,$varbind);
58505851
self.deb("Not Found") if $*DEBUG +& DEBUG::symtab;
5851-
58525852
return False;
58535853
}
58545854

0 commit comments

Comments
 (0)