Subject: | comments and special labeled variables not working with BUILD |
Hello again,
here are some new strange errors:
use strict;
use warnings;
use Test::More;
use Test::Exception;
use Dios;
class Test1 {
has $.foo;
submethod BUILD (
# :$foo
)
{ 42 }
}
class Test2 {
has $.foo;
submethod BUILD (
:foo($new_foo)
)
{ 42 }
}
ok eval { Test1->new({foo => 1}) }, 'ignore comment';
ok eval { Test2->new({foo => 1}) }, 'labeled argument';
done_testing();
When i only make 1 test in the file, both single fail. When i make Test1 & Test2, only Test1 fail. When i make Test2 & Test1 both fail.
I am not sure how bad this cases are, the first one took me some hours to realize the comment is not working, the second was a try to find the first bug.