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


   19:34 <pmichaud> r:  sub abc() returns Int { my $r = 3.5; $r  };  my $x = 
abc();  say 'alive';
   19:34 <p6eval> rakudo 231137: OUTPUT«Type check failed for return value; 
expected 'Int' but got 'Rat'␤  in sub abc at /tmp/P8uacuh4gB:1␤  in block  at 
/tmp/P8uacuh4gB:1␤␤»

According to S02:1363,  a return value not matching a constraint should
internally call C<fail>, which means the above shouldn't die immediately.

jnthn++ notes that this may be a deviation from the way type constraints
are handled by other parts of the spec; thus the spec may want changing.
If so, we can file a spec issue for that; in the meantime I'm filing the
rakudobug so it doesn't get forgotten.

Pm

Reply via email to