Avatar
Avatar
kntk
@swift-main func printGenericInfo<T>(_ value: T) { let t = type(of: value) print("'\(value)' of type '\(t)'") } protocol P {} extension String: P {} let stringAsP: P = "Hello!" printGenericInfo(stringAsP)
swiftNightly BOT 1/12/2025 3:21 PM
'Hello!' of type 'P'