{{$NEXT}}
+ [BUG FIXES]
+
+ * Validating duck_type type constraint turned out to work only by accident,
+ and only when not running under the debugger. This has been fixed.
+ (Florian Ragwitz)
+
2.0203 Tue, Aug 23, 2011
[BUG FIXES]
my $self = shift;
my $val = shift;
- return 'Scalar::Util::blessed(' . $val . ') '
- . '&& Scalar::Util::blessed(' . $val . ') ne "Regexp" '
+ return 'my $val = ' . $val . '; Scalar::Util::blessed($val) '
+ . '&& Scalar::Util::blessed($val) ne "Regexp" '
. '&& &List::MoreUtils::all('
- . 'sub { ' . $val . '->can($_) }, '
+ . 'sub { $val->can($_) }, '
. join(', ', map { B::perlstring($_) } @{ $self->methods })
. ')';
};
my @methods = @{ $args{methods} };
$args{constraint} = sub {
- blessed( $_[0] ) ne 'Regexp'
- && all { $_[0]->can($_) } @methods;
+ my $val = $_[0];
+ blessed($val) ne 'Regexp'
+ && all { $val->can($_) } @methods;
};
$args{inlined} = $inliner;