I have a static function I want to call on a class conforming to a protocol.
protocol P {
static func f();
}
class C: P {
static func f() {}
}
Is there a way to store C.self as a variable with a type that conforms to the protocol? Below does not compile, but it's what I'm ideally trying to do:
let a: AnyClass<P> = C.self;
a.f();