cps icon indicating copy to clipboard operation
cps copied to clipboard

CPS doesn't rewrite locals with proc types correctly

Open alaviss opened this issue 4 years ago • 3 comments

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.}

alaviss avatar Jun 24 '21 18:06 alaviss

What made you decide this is a CPS bug?

disruptek avatar Jun 24 '21 21:06 disruptek

I just put it there until I figure out where the issue is from.

alaviss avatar Jun 24 '21 23:06 alaviss

Reported upstream: nim-lang/Nim#19010

alaviss avatar Oct 17 '21 22:10 alaviss