Re: Rationale of return types from subroutines always being nullable?
[email protected] (Quanrong via perl6-users) Mon, 20 Oct 2025 19:28:02 +0200
| Newsgroups | perl.perl6.users |
|---|---|
| Message-ID | <[email protected]> |
> Oh, but it *does* serve a purpose, and it *will* fire under the right
circumstances! For instance:
>
> $ raku -e 'sub a(--> Int:D) { Int }; 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
You are right! I had missed that, it's very obvious in retrospective.
Now I understand.
Thanks for your help! And for working on Raku :)