assume that the check will be wrapped in parentheses when it is inlined.
The inlined code should include any checks that your type's parent types
-do. For example, the C<Value> type's inlining sub looks like this:
-
- sub {
- 'defined(' . $_[1] . ')'
- . ' && !ref(' . $_[1] . ')'
- }
-
-Note that it checks if the variable is defined, since it is a subtype of
-the C<Defined> type. However, to avoid repeating code, this can be optimized as:
+do. If your parent type constraint defines its own inlning, you can simply use
+that to avoid repeating code. For example, here is the inlining code for the
+C<Value> type, which is a subtype of C<Defined>:
sub {
$_[0]->parent()->_inline_check($_[1])