Skip to content

Commit 734dfca

Browse files
authored
Merge pull request #315 from dpvc/union-patch
Fix error with checking for uncombined sets.
2 parents a2dde28 + 29080bb commit 734dfca

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/Value/Union.pm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,13 @@ sub isReduced {
268268
if ($x->intersects($y)) {$error = "overlaps"; last}
269269
if (($x + $y)->reduce->type ne 'Union') {$error = "uncombined intervals"; last}
270270
}
271-
if ($S.length) {
271+
if ($S->length) {
272272
foreach my $x (@{$sU->{data}}) {
273273
my $y = ($x + $S)->reduce;
274-
if ($y->type ne 'Union' || $y->length != $S->length) {$error = "uncombined sets"; last}
274+
if ($y->type ne 'Union' && ($y->type ne 'Set' || $y->length == $S->length)) {
275+
$error = "uncombined sets";
276+
last;
277+
}
275278
}
276279
}
277280
$error = "overlaps in sets" if !$error && $S->intersects($U);

0 commit comments

Comments
 (0)