You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.)
Migrated from rt.perl.org#126895 (status was 'new')
Searchable as RT126895$
The text was updated successfully, but these errors were encountered: