"Shawn M Moore via RT" <bug-Mouse@rt.cpan.org> writes:
Show quoted text> It's also possible that Mouse could actually *check* for breakage
> before warning, by looking for attributes with default/builder without
> lazy, BUILD or BUILDARGs, etc.
I feel a little stronger about this than Shawn.
I see how this warning is trying to be helpful and prevent users from
accidentally doing something they didn't intent. However, it hurts a lot
of users that legitimately inherit from non-Mouse classes without using
MouseX::Foreign, like when doing what Shawn described above.
Unfortunately though, I don't think the approach he suggests is a very
good one. It's not possible to detect all cases where inheriting from
non-Mouse classes without MouseX::Foreign would cause trouble. While
trying to do that might very well alleviate some of the suffering, it
doesn't fix the actual problem, and the other suggestion of introducing
an environment variable to turn the warning off won't either.
I would like to suggest removing this warning or at least making it
opt-in instead of opt-out. Users could, if they want the additional
"safety", set an environment variable, pass an additional import()
argument, or maybe even load a Mouse::Strict instead of Mouse, to enable
this warning, and possibly future other ones.
Also, as far as I understand the philosophy behind Mouse, it's a
declared goal to be as close as possible to Moose's behaviour, at least
as far as the basic user-facing interface is concerned. Moose doesn't
issue a warning like that, so Mouse probably doesn't want to do that
either.
I'm all in favour of helping users out by providing useful errors and
warnings in case it's clear that they actually did something
wrong. However, detecting that in this case isn't quite possible.