Skip to content

Cannot create a type referencing a local constant #260

Description

@alaviss
import cps

proc foo() {.cps: Continuation.} =
  const X = 10
  var x: array[X, int]

got:

test.nim(3, 14) template/generic instantiation of `cps` from here
test.nim(5, 16) Error: undeclared identifier: 'X'

The problem is that Nim did not inline X into array[X, int], which is carried over to the environment definition, where X doesn't exist.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions