Subject: | bad usage of Module::Runtime |
Date: | Thu, 6 Feb 2014 23:33:48 +0000 |
To: | bug-Moose [...] rt.cpan.org |
From: | Zefram <zefram [...] fysh.org> |
Moose::Util has some code that calls Module::Runtime's use_module()
and use_package_optimistically(), and attempts to supply the version
parameter or not as the situation requires. However, the attempt
is faulty. It takes the form
use_module($module, $require_version ? $version : ())
but the M:R functions have prototype ($;$), so the () is put in scalar
context and yields undef. The bug didn't manifest with M:R-0.013,
because in that version M:R had a bug whereby it would mistakenly treat a
version parameter of undef as if no version parameter had been supplied.
M:R-0.014 fixes that bug, so now the undef gets passed through to the
module's ->VERSION method, which by default dies on undef, so Moose's
calls fail.
Attached patch fixes Moose::Util.
-zefram
Message body is not shown because sender requested not to inline it.