sorear/niecza — Issue #104: Default .new does wrong thing with arrays
Author: colomon
Created: 2012-01-18 13:02:06+00:00
State: open

colomon: perl6: class Foo { has @.bar; }; my $a = Foo.new(bar => [1, 2, 3]); say $a.bar.WHAT; say $a.bar[0].WHAT; say $a.bar.perl
[07:44am] p6eval: rakudo ed943e: OUTPUT«Array()␤Int()␤Array.new(1, 2, 3)␤»
[07:44am] p6eval: ..pugs b927740: OUTPUT«Array␤Int␤[1, 2, 3]␤»
[07:44am] p6eval: ..niecza v13-300-g280d918: OUTPUT«Array()␤Array()␤[[1, 2, 3]].list␤»
[07:45am] colomon: ... I think that's a niecza-bug
[07:46am] colomon: niecza: class Foo { has @.bar; }; my $a = Foo.new(bar => <1 2 3>); say $a.bar.WHAT; say $a.bar[0].WHAT; say $a.bar.perl
[07:46am] p6eval: niecza v13-300-g280d918: OUTPUT«Array()␤Str()␤["1", "2", "3"].list␤»
[07:47am] masak: colomon: looks like.
[07:47am] colomon: niecza: class Foo { has @.bar; }; my $a = Foo.new(bar => <1 2 3>.map(+*)); say $a.bar.WHAT; say $a.bar[0].WHAT; say $a.bar.perl
[07:47am] p6eval: niecza v13-300-g280d918: OUTPUT«Array()␤Int()␤[1, 2, 3].list␤»
[07:47am] colomon: niecza: say <1 2 3>.map(+*).WHAT
[07:47am] p6eval: niecza v13-300-g280d918: OUTPUT«List()␤»