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