From: Dave Rolsky Date: Mon, 25 Apr 2011 01:40:41 +0000 (-0500) Subject: Union inlining should always be surrounded by its own set of parens, for safety X-Git-Tag: 2.0100~39 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=576c9cfccb583b51f27bc6e0bfbc51eecb95dfc9;p=gitmo%2FMoose.git Union inlining should always be surrounded by its own set of parens, for safety --- diff --git a/lib/Moose/Meta/TypeConstraint/Union.pm b/lib/Moose/Meta/TypeConstraint/Union.pm index ae0ea12..f1c0262 100644 --- a/lib/Moose/Meta/TypeConstraint/Union.pm +++ b/lib/Moose/Meta/TypeConstraint/Union.pm @@ -81,9 +81,12 @@ sub _inline_check { my $self = shift; my $val = shift; - return - join ' || ', map { '(' . $_->_inline_check($val) . ')' } - @{ $self->type_constraints }; + return '(' + . ( + join ' || ', map { '(' . $_->_inline_check($val) . ')' } + @{ $self->type_constraints } + ) + . ')'; }; sub inline_environment {