-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set_formatter() failures introduced in DateTime-1.37 #49
Comments
I was able to reproduce this on my Perl 5.24, DateTime 1.41, Specio 0.31. I think I tracked this exception down to this block of code: https://metacpan.org/source/DROLSKY/Specio-0.31/lib/Specio/Constraint/AnyCan.pm#L32-40, at first glance there didn't seem a way for this exception to be generated by that code since unblessed refs fail the But I just tested something about use List::Util qw( all );
sub foo { all { warn $_[0] && $_ } qw( 0 1 2 ) }
foo( qw( foo bar baz ) );
The And that's where I left it last night. I'll pick up from here in the next day or so. |
After some comments in irc.perl.org #perl, I tried reproducing just the weird use v5.10;
use List::Util;
sub foo {
state $sub = eval 'sub { List::Util::all { warn $_[0] && $_ } qw( 0 1 2 ) }';
$sub->( @_ );
}
foo( qw( foo bar baz ) );
This produces exactly the behavior I'd expect, so the problem can't be isolated to just this level. |
@chanwilson could we know what version of List::Util (Scalar-List-Utils) you have installed, please? |
List::Util::VERSION is 1.46 |
This works fine outside of the debugger, fails under it
|
A string eval doesn't seem necessary to get strange results. This program:
prints
outside the debugger and
inside it. |
Simplified further:
|
I though that maybe Either way, I'm not sure how I might go about fixing this in Specio, which is where the problem really lies. |
A workaround would be to replace the |
Another workaround would be to capture |
@arodland - good points. I don't want to get rid of |
Fixed in Specio 0.32 |
0.32 2017-01-12 - Fixed a bug in the inlining for types create by any_can_type() and object_can_type(). This inlining mostly worked by accident because of some List::Util XS magic, but this broke under the debugger. Reported by Christian Walde (GH #17) and Chan Wilson (houseabsolute/DateTime.pm#49).
I'm seeing this in formerly-working code (heavy with Moose and other modules) after upgrading DateTime. Interestingly enough if the below snippet is placed in a file and run outside the debugger it works as expected, but will always fail when run in the debugger like below.
Tracing the set_formatter call gives this:
Hopefully this is enough information to debug and fix!
The text was updated successfully, but these errors were encountered: