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
Dec 18, 2016
· 2 comments
Assignees
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
the compiler crashes if we call this generic function using a closure argument where the inout argument type of the supplied closure is a closure itself:
The bug(limitation?) above limits a use case for the global sequence(state:next: ) function; the case where one would like to use a closure as the mutable state parameter.
// dummy example (not even making use of the state 'foo') yielding the same compiler crashvari = 0letseq = sequence(
state: { () -> () in () },
next: { (foo: inout () -> ()) -> Int? ini += 1guardi < 5else { returnnil }
returni
})
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
Environment
Xcode 8.1 (8B62), Swift version 3.0.1 (swiftlang-800.0.58.6 clang-800.0.42.1)
Additional Detail from JIRA
md5: 2f32d2c1df386af295fa1b28177baf01
is duplicated by:
Issue Description:
We may successfully supply a closure with an
inout
closure as argument to a non-generic function:If we define a generic function with a closure parameter that has an
inout
argument (using the generic typeholder),the compiler crashes if we call this generic function using a closure argument where the
inout
argument type of the supplied closure is a closure itself:The crash produces the following crash dump/error:
The bug(limitation?) above limits a use case for the global
sequence(state:next: )
function; the case where one would like to use a closure as the mutablestate
parameter.The text was updated successfully, but these errors were encountered: