# New Ticket Created by Dan Zwell # Please include the string: [perl #132525] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=132525 >
The following function runs fine when it's not defined in an external file: our sub get-array(--> Array[Pair]) { return my Pair @pairs; } But when if you put the above code in a module and run it with: perl6 -I. -MMyModule -e 'MyModule::get-array' The output is: Type check failed for return value; expected Array[Pair] but got Array[Pair].new() in sub get-array at MyModule.pm6 (MyModule) line 2 Tested with: Rakudo version 2017.10 built on MoarVM version 2017.10 Rakudo version 2017.10-196-gfff43fd70 built on MoarVM version 2017.10-77-gb9a01f75