type(of: v)
P
as? P.Type
protocol P {} extension Int: P {} func checkT<T>(_ t: T) { let tIsP1 = type(of: t) == P.self print("tIsP1=\(tIsP1)") let tIsP2 = type(of: t) is P.Type print("tIsP2=\(tIsP2)") } let a: P = 1 checkT(a)