class T { BEGIN { my %calculator = ( min => sub ($a, $b) { }, max => sub ($a, $b) { }, mean => sub ($a, $b) { }, ); my $set = %calculator<>:k.Set; has $.method where * (elem) $set = 'min'; # This version doesn't work # has $.t where { $_ (elem) $set } = 'min'; # This version works. } } T.new(:method('min')).t.say