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
Sep 11, 2017
· 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
class Test {
func thing(_ param: inout (() -> Void)?) -> Self {
var item: Int = 8
param = { [weak self] in self?.intFunc(item) }
return self
}
public func intFunc(_ item: Int?) { }
}
compile with swift swift_bug.swift
Expected Results: a successful build with a "Variable 'item' was never mutated, consider changing to 'let' constant" warning (that's what happens with the swift 3.1 compiler)
Actual Results: The swift compiler Segfaults (see attached log)
The compiler no longer segfaults with any of the following changes:
`var item` is changed to `let item`
`func thing` returns something besides `Self` (`Int`, for instance)
the closure assigned to `param` captures `self` as a strong reference
The text was updated successfully, but these errors were encountered:
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 beta 6++, macOS 10.12.6
Additional Detail from JIRA
md5: d6f68b1dd87481cd5479384c61a3b7ba
Issue Description:
Steps to Reproduce:
Add the following to a file (
swift_bug.swift
):compile with
swift swift_bug.swift
Expected Results: a successful build with a "Variable 'item' was never mutated, consider changing to 'let' constant" warning (that's what happens with the swift 3.1 compiler)
Actual Results: The swift compiler Segfaults (see attached log)
The compiler no longer segfaults with any of the following changes:
`var item` is changed to `let item`
`func thing` returns something besides `Self` (`Int`, for instance)
the closure assigned to `param` captures `self` as a strong reference
The text was updated successfully, but these errors were encountered: