Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

static var works at toplevel but not inside a proc: Error: cannot evaluate at compile time: s #94

Open
timotheecour opened this issue Apr 6, 2020 · 0 comments

Comments

@timotheecour
Copy link
Owner

static var works at toplevel but not inside a proc: Error: cannot evaluate at compile time: s

whether it's by design or not, couldn't this be made to work?

Example

when defined case1: # D20200405T172229:here
  template fun1() =
    static:
      var s = @[10,11,12]  # works
  fun1()
  proc fun2() =
    static:
      var s = @[10,11,12] # Error: cannot evaluate at compile time: s
  fun2()

when defined case2:
  proc fun2() =
    const a = block:
      var s = @[10,11,12] # ditto
      s
  fun2()

Current Output

Error: cannot evaluate at compile time: s

Expected Output

works?

Possible Solution

  • In file xyz there is a call that might be the cause of it.

Additional Information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant