Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defined-or causes stringify / boolean overload call when run under Devel::Cover #350

Open
mohawk2 opened this issue Nov 5, 2024 · 0 comments

Comments

@mohawk2
Copy link
Contributor

mohawk2 commented Nov 5, 2024

As worked around in EntropyOrg/p5-Data-Frame@b3f456d, use of:

        return ( $self->_tie_hash // $self );

caused the stringify overload to be called, which in that context caused a problem. Switching it to:

        my $tmp = $self->_tie_hash; # avoid // as breaks Devel::Cover
        $tmp = $self if !defined $tmp;
        $tmp;

made the problem go away. On adding a confess to the stringify overload, the stack trace read:

t/traits.t ................. STACKTRACE at (dir)/blib/lib/Data/Frame.pm line 209.
        Data::Frame::string(Data::Frame__WITH__Data::Frame::Role::Rlike=HASH(0x6033b1751e00)) called at (dir)/blib/lib/Data/Frame.pm line 48
        Data::Frame::__ANON__(Data::Frame__WITH__Data::Frame::Role::Rlike=HASH(0x6033b1751e00), undef, "") called at (dir)/blib/lib/Data/Frame/Partial/Sugar.pm line 85
        Data::Frame::Partial::Sugar::__ANON__(Data::Frame__WITH__Data::Frame::Role::Rlike=HASH(0x6033b1751e00), undef, "") called at (eval 526)[(perlbrew)/libs/perl-5.32.0@normal/lib/perl5/Sub/Quote.pm:3] line 45
        Data::Frame__WITH__Data::Frame::Role::Rlike::new("Data::Frame__WITH__Data::Frame::Role::Rlike", "columns", ARRAY(0x6033b170ea00)) called at (eval 525)[(perlbrew)/libs/perl-5.32.0@normal/lib/perl5/Sub/Quote.pm:3] line 27
        Data::Frame::new("Data::Frame__WITH__Data::Frame::Role::Rlike", "columns", ARRAY(0x6033b170ea00)) called at t/traits.t line 12

so Sub::Quote may be part of the fun.

mohawk2 referenced this issue in EntropyOrg/p5-Data-Frame Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant