Re: Rationale of return types from subroutines always being nullable?

[email protected] (ToddAndMargo via perl6-users) Tue, 21 Oct 2025 17:11:29 -0700
Newsgroups perl.perl6.users
Message-ID <[email protected]>
On 10/21/25 1:55 AM, Elizabeth Mattijsen wrote:

> Well, you could want it when you want to make sure something gets initialized:
> 
> $ raku -e 'sub a(--> Int:D) { my Int $b; $b }; a'
> Type check failed for return value; expected Int:D but got Int (Int)
>    in sub a at -e line 1
>    in block <unit> at -e line 1

Makes sense.  Thank you