Avatar
@swift-main -enable-experimental-feature ImplicitOpenExistentials 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) (edited)