Skip Menu |
Report information
Id: 127309
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: siavash.askari.nasr [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



To: rakudobug [...] perl.org
From: Siavash <siavash.askari.nasr [...] gmail.com>
Date: Mon, 18 Jan 2016 22:51:04 +0330
Subject: Type check failure for Array[...] as return value caused by irrelevent inclusion from another compunit
Download (untitled) / with headers
text/plain 710b
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
Download (untitled) / with headers
text/plain 142b
Still present in Rakudo version 2016.07.1-88-g15ee3c3 built on MoarVM version 2016.07-11-g11e02fe -- Cheers, ZZ | https://twitter.com/zoffix


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org