relevant code:
#composing the types on initialization (from YAML)
$new-model.HOW.add_attribute($new-model, Attribute.new(
:name<@.columns>, :has_accessor(1), :type(Array), :package($new-model.WHAT),
));
#later in BUILD
multi submethod BUILD (:$!driver, :$!db, :$!quote, :$!dbo, :@columns?) {
use nqp;
say self.WHAT.^name; # matches the $new-model name
"Attributes: {self.^attributes.map({ .gist }).join(", ")}".say;
nqp::p6bindattrinvres(self, Array, '@!columns', @columns);
output:
Koos::Models::Customer
Attributes: Array @.columns, Mu $!table-name, Mu $!db, Mu $!quote, Mu $!model-class, Mu $!driver, Mu $!row-class, Mu $!dbo, Mu $!filter, Mu $!options, Mu $!inflate, Mu $!first-next
P6opaque: no such attribute '@!columns' on type Array in a Koos::Models::Customer when trying to bind a value