1. class X::Cannot::New { ... }
  2. my class Whatever {
  3. multi method ACCEPTS(Whatever:D: $ --> True) { }
  4. multi method perl(Whatever:D: --> '*') { }
  5. multi method Str(Whatever:D: --> '*') { }
  6. }
  7. my class HyperWhatever {
  8. multi method new(HyperWhatever:) { X::Cannot::New.new(class => self).throw }
  9. multi method ACCEPTS(HyperWhatever:D: $ --> True) { }
  10. multi method perl(HyperWhatever:D:) { '**' }
  11. }
  12. sub HYPERWHATEVER (&c) { sub (*@_) { map &c, @_ } }