CPS doesn't rewrite locals with proc types correctly
alaviss opened this issue · comments
alaviss commented
import cps
proc foo(x: int) =
discard
proc bar() {.cps: Continuation.} =
var f = foo
f(10)
bar()
Got:
test.nim(7, 7) Error: inconsistent typing for reintroduced symbol 'f': previous type was: proc (x: int){.noSideEffect, gcsafe, locks: 0.}; new type is: proc (x: int){.closure.}
Smooth Operator commented
What made you decide this is a CPS bug?
alaviss commented
I just put it there until I figure out where the issue is from.
alaviss commented
Reported upstream: nim-lang/Nim#19010