Treating instances of a protocol type as a different subclass