summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-05-26 21:01:35 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-05-26 21:01:35 +0000
commitbfecbe023497ce038a00dc2ff7ed0a6bf761353d (patch)
treea0640d86ca5a66c6f49c4513325a995f2929f7cf
parentf55207849d6727b5bd98d089e3560e0112047950 (diff)
downloadperl-bfecbe023497ce038a00dc2ff7ed0a6bf761353d.tar.gz
Fix a remaining B::Lint bug.
p4raw-id: //depot/perl@16806
-rw-r--r--ext/B/B/Lint.pm5
-rw-r--r--ext/B/t/lint.t7
2 files changed, 7 insertions, 5 deletions
diff --git a/ext/B/B/Lint.pm b/ext/B/B/Lint.pm
index cb15b79339..9a977c8041 100644
--- a/ext/B/B/Lint.pm
+++ b/ext/B/B/Lint.pm
@@ -250,6 +250,11 @@ sub B::SVOP::lint {
if ($gv->NAME =~ /^_./ && $gv->STASH->NAME ne $curstash) {
warning('Illegal reference to private name %s', $gv->NAME);
}
+ } elsif ($opname eq "method_named") {
+ my $method = $op->gv->PV;
+ if ($method =~ /^_./) {
+ warning("Illegal reference to private method name $method");
+ }
}
}
if ($check{undefined_subs}) {
diff --git a/ext/B/t/lint.t b/ext/B/t/lint.t
index 6f21eaf6c3..7be86acce2 100644
--- a/ext/B/t/lint.t
+++ b/ext/B/t/lint.t
@@ -63,13 +63,10 @@ RESULT
Illegal reference to private name _x at -e line 1
RESULT
- {
- local $TODO = q/doesn't catch methods/;
- runlint 'private-names', 'sub A::_f{};A->_f()', <<'RESULT',
+ runlint 'private-names', 'sub A::_f{};A->_f()', <<'RESULT',
Illegal reference to private method name _f at -e line 1
RESULT
- 'private-names';
- }
+ 'private-names (method)';
runlint 'undefined-subs', 'foo()', <<'RESULT';
Undefined subroutine foo called at -e line 1