sub foo { my ($self) = @_; croak "..." unless ref($self) && $self->isa("AnInterface") }