Make sure that inlining union preserves the inline env
[gitmo/Moose.git] / lib / Moose / Meta / TypeConstraint / Union.pm
index feb4697..ae0ea12 100644 (file)
@@ -86,6 +86,13 @@ sub _inline_check {
         @{ $self->type_constraints };
 };
 
+sub inline_environment {
+    my $self = shift;
+
+    return { map { %{ $_->inline_environment } }
+            @{ $self->type_constraints } };
+}
+
 sub equals {
     my ( $self, $type_or_name ) = @_;