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
OS X 10.11.6
Xcode Version 8.2.1 (8C1002) and command line
Swift 3.1 and 4 development snapshot 2017-05-12
Additional Detail from JIRA
Votes
1
Component/s
Compiler
Labels
Bug
Assignee
None
Priority
Medium
md5: ede303f7483f4ebdc4bd34da3f042a5a
duplicates:
SR-9760 Can't add @escaping to an argument of generic function having typealiased function type
Issue Description:
Using a function-type type alias as an escaping parameter type fails to compile:
protocolFoo
{
associatedtypeBartypealiasCallback = (Bar) -> VoidvarcurrentValue: Bar { get }
}
// Error: @escaping attribute only applies to function typesfunccallBroken<T: Foo>(foo: T, callback: @escapingT.Callback) {
DispatchQueue.main.async { callback(foo.currentValue) }
}
// Spelling it out works (of course).funccallWorks<T: Foo>(foo: T, callback: @escaping (T.Bar) -> Void) {
DispatchQueue.main.async { callback(foo.currentValue) }
}
I know there is SR-2316 and several duplicates. Especially the comment by Jordan Rose addresses what I think is still broken:
The actual behavior we want here is that @escaping is a property of the parameter, not the function type, but we don't currently allow you to write @escaping on typealiases.
Later in the comments, David Grove added "fix confirmed" but he was probably referring to something else.
I tested this with swift-3.1-RELEASE.xctoolchain and swift-DEVELOPMENT-SNAPSHOT-2017-05-12-a.xctoolchain.
The text was updated successfully, but these errors were encountered:
I suspect we aren't properly resolving the typealias here—it works if it's not on a generic parameter (and doesn't mention Bar, of course). @slavapestov, any insights?
Environment
OS X 10.11.6
Xcode Version 8.2.1 (8C1002) and command line
Swift 3.1 and 4 development snapshot 2017-05-12
Additional Detail from JIRA
md5: ede303f7483f4ebdc4bd34da3f042a5a
duplicates:
Issue Description:
Using a function-type type alias as an escaping parameter type fails to compile:
I know there is SR-2316 and several duplicates. Especially the comment by Jordan Rose addresses what I think is still broken:
Later in the comments, David Grove added "fix confirmed" but he was probably referring to something else.
I tested this with swift-3.1-RELEASE.xctoolchain and swift-DEVELOPMENT-SNAPSHOT-2017-05-12-a.xctoolchain.
The text was updated successfully, but these errors were encountered: