t $test .= new(:string); # TIMTOADY and all that ;)
You can pass objects to BUILD that you don't store in the object:
class MattTest {
submethod BUILD (:$foo) {
say $foo;
}
}
hth,
-db.
my $test = MattTest(:string('abc'));
# Check to see the class is the right kind
I'm trying to use a non-default constructor for a class under Pugs 6.2.13, like
so
class MattTest {
sub new (Class $class : Str $string) {
say "Passed $string to the constructor for $class" ;
return $class.bless ;
}
}
my $test = MattTest.new('abc') ;
This is failing with the fol