You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The expectation is that the Swift compiler can convert anonymous tuples to labelled tuples on-demand through type inference when the tuple member types are compatible.
This expectation holds true in most scenarios, for instance:
However, as soon as the tuple conversion takes place within the context of a type, it appears to fail:
f( Just(0).combineLatest(Just("")) ) // Global function 'f' requires the types '(Int, Just<String>.Output)' and 'T' (aka '(a: Int, b: String)') be equivalent
protocolP {
funcf<PT: Publisher>(_t: PT) wherePT.Output == T
}
p.f(Just((0, ""))) // Instance method 'f' requires the types '(Int, String)' and 'T' (aka '(a: Int, b: String)') be equivalent
The text was updated successfully, but these errors were encountered:
Environment
swift-driver version: 1.26.21 Apple Swift version 5.5.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30)
Target: x86_64-apple-macosx12.0
Additional Detail from JIRA
md5: c7b7fdce4d97e5cbf51aa2e27f52979e
Issue Description:
Original discussion: https://forums.swift.org/t/tuple-label-conversion-breaks-for-member-functions/54571/3
The expectation is that the Swift compiler can convert anonymous tuples to labelled tuples on-demand through type inference when the tuple member types are compatible.
This expectation holds true in most scenarios, for instance:
However, as soon as the tuple conversion takes place within the context of a type, it appears to fail:
The text was updated successfully, but these errors were encountered: