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

Owner: Nobody
Requestors: siavash.askari.nasr [at]

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

To: rakudobug [...]
From: Siavash <siavash.askari.nasr [...]>
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: 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:
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 |

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

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