fix up the inlining test
[gitmo/Moose.git] / lib / Moose / Meta / TypeConstraint / Union.pm
index 8b695e0..ae0ea12 100644 (file)
@@ -71,11 +71,10 @@ sub _actually_compile_type_constraint {
     };
 }
 
-sub has_inlined_type_constraint {
+sub can_be_inlined {
     my $self = shift;
 
-    return all { $_->has_inlined_type_constraint }
-        @{ $self->type_constraints };
+    return all { $_->can_be_inlined } @{ $self->type_constraints };
 }
 
 sub _inline_check {
@@ -87,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 ) = @_;