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
swift-ci opened this issue
Jun 11, 2018
· 2 comments
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of software
Xcode 9.4 (9F1027a)
Apple Swift version 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2)
Target: x86_64-apple-darwin17.5.0
Additional Detail from JIRA
Votes
0
Component/s
Compiler
Labels
Bug, CompilerCrash
Assignee
None
Priority
Medium
md5: eab294d27a1c3f11c4eaf735faec2b76
duplicates:
SR-75 Referencing a protocol function crashes the compiler
Issue Description:
Current version of swift compiler crashes on following minimal code sample
{Code}
protocol A {}
extension A {
func methodA() { print(self) }
}
extension String: A {}
let array = ["One", "Two", "Three"]
.map { $0 as? A }
.compactMap { $0 }
.map(A.methodA)
{Code}
Getting rid of last map (where compiler should infer type of result by the type of closure, obtained via accessing protocol extension method by typename) fixes issue
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of software
Attachment: Download
Environment
Xcode 9.4 (9F1027a)
Apple Swift version 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2)
Target: x86_64-apple-darwin17.5.0
Additional Detail from JIRA
md5: eab294d27a1c3f11c4eaf735faec2b76
duplicates:
Issue Description:
Current version of swift compiler crashes on following minimal code sample
{Code}
protocol A {}
extension A {
func methodA() { print(self) }
}
extension String: A {}
let array = ["One", "Two", "Three"]
.map { $0 as? A }
.compactMap { $0 }
.map(A.methodA)
{Code}
Getting rid of last map (where compiler should infer type of result by the type of closure, obtained via accessing protocol extension method by typename) fixes issue
Attached stack trace crashdump.txt
The text was updated successfully, but these errors were encountered: