Created
April 25, 2014 13:55
-
-
Save retupmoca/11290398 to your computer and use it in GitHub Desktop.
moar CStruct repr precomp bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
use NativeCall; | |
class foo is repr('CStruct'); # works fine without the repr('CStruct') | |
has CArray $!foo; | |
method set-foo(CArray $arr) { | |
$!foo := $arr; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> perl6 -I. user.pl | |
alive | |
> perl6 --target=mbc --output=foo.moarvm foo.pm6 | |
> perl6 -I. user.pl | |
Can not bind non-existent attribute '$!foo' | |
in method set-foo at foo.pm6:8 | |
in block at user.pl:6 | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use foo; | |
use NativeCall; | |
my $arr = CArray[int8].new; | |
$arr[0] = 42; | |
foo.new.set-foo($arr); | |
say 'alive'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment