Open
Description
Previous ID | SR-15823 |
Radar | None |
Original Reporter | @philipturner |
Type | Bug |
Attachment: Download
Additional Detail from JIRA
Votes | 0 |
Component/s | |
Labels | Bug |
Assignee | None |
Priority | Medium |
md5: 7ac04b0e86fad47aa1f9a8580634f6ab
Issue Description:
The following code crashes at runtime under specific conditions as explained below. As-is, it crashes. To stop it from crashing, follow instructions in its comments.
import _Differentiation
// Remove the @noDerivative attribute here...
typealias MyType = @differentiable(reverse) (inout Float, @noDerivative Int) -> Void
@differentiable(reverse)
// ... and here to stop it from crashing.
func myFunc(_ x: inout Float, _ y: @noDerivative Int) -> Void {}
// Alternatively, un-comment out this line and it no longer crashes.
//print("hi")
print(myFunc as MyType)