# Pastebin 19SqhrnQ MacBookProRetinaFCO:Injector fernando$ perl6 -e ' multi trait_mod:(Attribute \attr, :$chainable!) is export { my \clazz = attr.package; my \type = attr.type; my $meth; if $chainable ~~ Str { $meth = $chainable; } else { $meth = "set-" ~ attr.name.substr(2); } note "creating $meth"; clazz.^add_multi_method($meth, method (\value where * ~~ type) { attr.set_value(self, value); self }); clazz.^compose; } class Bla { has $.ble is chainable; has $.bli is chainable; #; } my $o = Bla.new; $o.ble.say; $o.set-ble(1234).say; $o.ble.say; $o.set-ble(456).ble.say; ' creating set-ble creating set-bli (Any) P6opaque: no such attribute '$!bli' in block at -e line 28 MacBookProRetinaFCO:Injector fernando$