protocol P { static func foo() } extension Int: P { static func foo() { print("Int") } } let ty: P.Type = Int.self ty.foo()