Browse files

Make type objects work as Nil in non-scalar contexts.

  • Loading branch information...
1 parent 0af5e95 commit e45fc46ebda8e5549e668ffe6d5cba48fc359f65 @lizmat lizmat committed Jul 22, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 S02-bits.pod
4 S02-bits.pod
@@ -559,6 +559,10 @@ You can pass in arguments to the constructor as well:
my Dog $cerberus .= new(heads => 3);
my Dog $cerberus = $ => 3); # same thing
+Just like L</Nil>, type objects do not disappear in list context, but rely on
+something downstream to catch it or blow up. This allows type objects to be
+assigned to scalars, but to disappear in non-scalar contexts.
=head2 Coercive type declarations
The parenthesized form of type coercion may be used in declarations

0 comments on commit e45fc46

Please sign in to comment.