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
Function composition crashes with error: Execution was interrupted, reason: signal SIGSEGV: invalid address (fault address: 0x0). The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
I would expect to be able to call the composed function.
Steps to Reproduce
Paste the following a cell
fnsquare(x: Int) -> Int:
return x * x
fnincr(x: Int) -> Int:
return x +1fncompose[A: AnyType, B: AnyType, C: AnyType](f: fn(A) -> B, g: fn(B) -> C) -> fn(A) capturing-> C:
fnbar(a: A) -> C:
return g(f(a))
return bar
letincrsq= compose[Int, Int, Int](incr, square)
letv= incrsq(2)
print(v)
Bug Description
Function composition crashes with
error: Execution was interrupted, reason: signal SIGSEGV: invalid address (fault address: 0x0). The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
I would expect to be able to call the composed function.
Steps to Reproduce
Context
The text was updated successfully, but these errors were encountered: