Posts

Showing posts with the label perl6

Strange message declaring a Pointer[void] in a NativeCall perl6 module

Strange message declaring a Pointer[void] in a NativeCall perl6 module These snippets of code may seem odd, it's because I started with my original code and cut off pieces until I arrived to the minimal set of instructions that reproduced the error. So bear with the apparent uselessness. There are two perl6 modules, one use s the other one, and a program. This is the first module: use unit class test1; use NativeCall; use test2; method test { my Pointer[void] $dummy .= new; } The second module is included by the first one, but no part of it is actually used: unit module test2; use NativeCall; class A is repr('CStruct') is export { has Pointer[void] $.wrongdoer; has int32 $.a; } The program creates a test1 object and calls the test method: use lib '.'; use test1; my test1 $t .= new; $t.test; This program outputs an error, apparently caused by the assignment in the class test1's method test: Type check failed in assignment to $dummy; expected NativeCall::Typ...