if a union type has no common ancestors, ->parent should return undef
[gitmo/Moose.git] / lib / Moose / Meta / TypeConstraint / Union.pm
index befc557..e2ed92d 100644 (file)
@@ -136,6 +136,8 @@ sub parent {
     for my $parent ( $first->_collect_all_parents ) {
         return $parent if all { $_->is_a_type_of($parent) } @rest;
     }
+
+    return;
 }
 
 sub validate {