Minimal code:
#!/usr/bin/raku
class Widget {
submethod TWEAK(:$content, :$styles) {
say "t1\n";
}
}
class File is Widget {
submethod BUILD() {
say "b1";
}
}
my $xml = File.new();
And the output:
t1
b1
Relevant doc is at https://docs.raku.org/language/objects#Object_construction . I quote: "After the BUILD methods have been called, methods named TWEAK are called, if they exist, again with all the named arguments that were passed to new".
I'm using the version of rakudo that comes with Fedora 32 (rakudo-0.2020.02-1.fc32.x86_64 so probably February this year).