# New Ticket Created by  Sam S. 
# Please include the string:  [perl #126895]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=126895 >


Using a subset type as a type constraint for an optional routine parameter, 
throws an error when that argument is not passed - rather than falling back to 
the type object.

    subset A of Str where any <a aa aaa>;
    
    sub foo (A $x?) {};
    
    foo;     # Constraint type check failed for parameter '$x'

In comparison, a subset type constraint on a 'my' variable happily falls back 
to the type object if the variable is not initialized:

    subset A of Str where any <a aa aaa>;
    
    my A $x;
    say $x;  # (A)


(This is rakudo version 2015.11-424-g240b9ae built on MoarVM version 
2015.11-34-gc3eea17.)

Reply via email to