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



Sample code with this issue:
https://gist.github.com/CIAvash/1af6cd0fb167526ba847

Problem occurs when a class which has attributes similar to the return
value is used. And that class does not even need to be directly involved, just 
being
`use`d is enough. In the code mentioned above that class is class B.

In class A:
use B;
method make_str returns Array of Str {
    Array[Str].new: '' xx 3;
}

In class B:
has Str @.arr;

It gives this error: 'Type check failed for return value; expected
Array[Str] but got Array[Str].new("", "", "")'

It works when I remove `use B;`, change Str in `has Str @.arr` to
something else or change @.arr to $.arr.

IRC: http://irclog.perlgeek.de/perl6/2016-01-18#i_11905278

Reply via email to