Open dolmen opened 8 years ago
See usage of this expression real code: dolmen/angel-PS1 lib/AngelPS1/Plugin/Jobs.pm line 20
@pjcj Let me know if you need a simpler testcase as we are both at perlqah2016.
Note that Term::Chrome on CPAN is now in a higher (2.00) version that overloads bool
, so the 1.012 has to be used to show the issue.
Here are the steps to reproduce:
git clone --no-checkout https://github.com/dolmen/p5-Term-Chrome.git Term-Chrome
cd Term-Chrome
git checkout 07850d7
perl -MDevel::Cover -Ilib t/50-cover-bug.t
Output with Devel::Cover 1.23:
Devel::Cover 0.001: Collecting coverage data for branch, condition, pod, statement, subroutine and time.
Selecting packages matching:
Ignoring packages matching:
/Devel/Cover[./]
Ignoring packages in:
/home/dolmen/.plenv/versions/5.20.2/lib/perl5/site_perl/5.20.2/x86_64-linux
/home/dolmen/.plenv/versions/5.20.2/lib/perl5/site_perl/5.20.2
/home/dolmen/.plenv/versions/5.20.2/lib/perl5/5.20.2/x86_64-linux
/home/dolmen/.plenv/versions/5.20.2/lib/perl5/5.20.2
1..1
# perl v5.20.2
# Term::Chrome 1.012 lib/Term/Chrome.pm
Operation "bool": no method found, argument in overloaded package Term::Chrome::Color at t/50-cover-bug.t line 16.
Devel::Cover: Writing coverage database to /home/dolmen/tmp/Term-Chrome/cover_db/runs/1464041221.16197.00019
---------------------------- ------ ------ ------ ------ ------ ------ ------
File stmt bran cond sub pod time total
---------------------------- ------ ------ ------ ------ ------ ------ ------
lib/Term/Chrome.pm 47.5 9.0 33.3 47.0 60.0 2.1 34.6
t/50-cover-bug.t 91.6 n/a 50.0 100.0 n/a 97.8 88.2
Total 54.7 9.0 40.0 55.0 60.0 100.0 40.8
---------------------------- ------ ------ ------ ------ ------ ------ ------
My module Term::Chrome does advanced usage of operator overloading. Here is what it overloads:
Here is a test case that works correctly without Devel::Cover, but fails when I enable Devel::Cover 1.21. The failure:
Operation "bool": no method found, argument in overloaded package Term::Chrome::Color
.Output: