Cannot return a type with copy forbidden
alaviss opened this issue · comments
alaviss commented
import cps
type
O = object
proc `=copy`(dst: var O, src: O) {.error.}
proc foo(): O {.cps: Continuation.} =
result = O()
discard foo()
got:
test.nim(8, 1) Error: '=copy' is not available for type <O>; requires a copy because it's not the last read of 'cps environment(c_436207858).result'; routine: foo
We need a version of ()
that can consume the result.