1#!/usr/bin/perl
2
3# Copyright 2011-2019, Paul Johnson (paul@pjcj.net)
4
5# This software is free.  It is licensed under the same terms as Perl itself.
6
7# The latest version of this software should be available from my homepage:
8# http://www.pjcj.net
9
10# __COVER__ skip_test $] < 5.010 || !(eval "use Moose 2; 23")
11# __COVER__ skip_reason Moose 2 not available or unreliable with Devel::Cover
12
13use strict;
14use warnings;
15
16package Cover_branch_bug;
17
18use Moose;
19has meep => ( isa => 'HashRef', is => 'rw' );
20
21my $self = __PACKAGE__->new;
22
23$self->meep( { marp => 0 } );
24print "meep contains " . $self->wagh . "\n";
25
26$self->meep( { marp => 1 } );
27print "meep contains " . $self->wagh . "\n";
28
29sub wagh {
30    my ( $self ) = @_;
31    my $x = $self || 0;
32    return $self->meep->{marp} || 0;
33    # return $self || 0;
34}
35