[SR-5104] Protocol's associatedtype not correctly inferred when the type is a closure argument #47680
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
regression
swift 4.0
Environment
Xcode 9 beta 1
Additional Detail from JIRA
md5: e2edf34ed298b6b93cdf371c7823d0c9
duplicates:
relates to:
Issue Description:
SE-0110 seems to be confusing the compiler in this situation:
a protocol has an associated type
the protocol requires a method whose argument is a function
the argument of the methods's function is the associated type.
Under those conditions, the associated type seems to be inferred to be a "single element tuple" (which doesn't exist in Swift).
Note that the compiler fix-it offers to create a stub for the function it thinks to be missing, which however causes another compile error:
the workaround is to explicitly declare a typealias for the associated type:
The text was updated successfully, but these errors were encountered: