Drop optimized subs for all builtins - instead use the inlining code to generate...
[gitmo/Moose.git] / lib / Moose / Meta / TypeConstraint.pm
index 1f657ca..59fa7ec 100644 (file)
@@ -234,6 +234,14 @@ sub _actually_compile_type_constraint {
     return $self->_compile_hand_optimized_type_constraint
         if $self->has_hand_optimized_type_constraint;
 
+    if ( $self->has_inlined_type_constraint ) {
+        local $@;
+        my $sub = eval 'sub { ' . $self->_inline_check('$_[0]') . '}';
+        die $@ if $@;
+
+        return $sub;
+    }
+
     my $check = $self->constraint;
     unless ( defined $check ) {
         require Moose;