You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed the following strange behaviour regarding the nonlazy option for default values in class hierarchies. Consider the following three files:
A.pm:
package A;
use Mo qw(default);
has foo => 17;
1;
B.pm:
package B;
use Mo qw(default);
extends 'A';
has bar => 42;
1;
use.pl:
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use FindBin;
use lib $FindBin::Bin;
use A;
use B;
my $a = A->new;
say $a->foo;
my $b = B->new;
say $b->foo, $b->bar;
The output is as expected:
$ perl use.pl
17
1742
Setting the option nonlazy in A.pm, line 2:
use Mo qw(default nonlazy);
leads to this warning;
$ perl use.pl
17
Use of uninitialized value in say at use.pl line 15.
42
I noticed the following strange behaviour regarding the
nonlazy
option for default values in class hierarchies. Consider the following three files:A.pm:
B.pm:
use.pl:
The output is as expected:
Setting the option
nonlazy
in A.pm, line 2:leads to this warning;
What am I doing wrong?
The text was updated successfully, but these errors were encountered: