Hi all!

I just started learning Perl 6 about 5 days ago, so I may not know what I'm talking about, but I may have found a bug. I posted to #perl6 with my original code, and raydiak and timotimo were nice enough to golf it down for me:

Str in CStruct blows up:
$ perl6
> use NativeCall; class Foo is repr('CStruct') { has Str $.str }; my $foo = Foo.new(str => 'bar');
Cannot modify an immutable Str
  in block <unit> at <unknown file>:1
  in any <unit-outer> at <unknown file>:1

int32 in CStruct works fine:
$ perl6
> use NativeCall; class Foo is repr('CStruct') { has int32 $.i }; my $foo = Foo.new(i => 42);
Foo.new(i => 42)
> say $foo.i
42

Please let me know if I'm doing something wrong, or if this is a legit bug. Thanks!

Reply via email to