Closed Xliff closed 2 weeks ago
I think the issue's that CArray.^parameterize
and Pointer.^parameterize
take a parameter of type Mu:U
, but use routines that expect it to be of type Any
. Parameterizations with []
happen at compile-time, and when it happens in your example, the class hasn't been composed yet, so it fails the type check for Any
when it wouldn't otherwise. Writing the parameterization methods to only use routines that work with Mu
fixes the error for me.
@Kaiepi++ ... Have you run this solution through Roast? If not, I'd be willing.
I'm in the middle of running make spectest
for other changes, so I can't right now. I can make a PR for what I have so you can though.
The Problem
When attempting to define a self-referential structure from C, I ran into the following error:
This stems from the fact that it appears that CArray[] and Pointer[] do not see the self-referential nature of the declaration. Here is a small sample that exposes this issue:
Note that this does work, possibly due to special case handling:
Expected Behavior
Actual Behavior
Steps to Reproduce
Environment
perl6 -v
):