Subject: | Moo object construction problem caused by inheritance ( or something else ) |
Date: | Fri, 01 Sep 2017 12:33:06 +0000 |
To: | bug-Moo [...] rt.cpan.org |
From: | Илья Зайцев <zaytsew.ilya [...] gmail.com> |
Found strange behavior with package inheritance:
If module Foo::Bar extends Foo and we want to instantiate $bar calling
Foo::Bar->new() we will get an object with only Foo::Bar attributes if in
the main package(where we calling new) we have written "use Foo" before
"use Foo::Bar" OR if package Foo uses package Foo::Bar.
Explanation might be not clear, so, please, look at the repo
https://github.com/akaiusagi/foo ( travis
https://travis-ci.org/akaiusagi/foo ).
Tests can be fixed by changing order of "use Foo" and "use Foo::Bar" or by
commenting "use Foo::Bar;" line in Foo package.
Am I must not use Foo::Bar package in Foo? Or what is going on?
Thanks.