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

nimscript sigmatch error with static param #18275

Open
timotheecour opened this issue Jun 16, 2021 · 0 comments
Open

nimscript sigmatch error with static param #18275

timotheecour opened this issue Jun 16, 2021 · 0 comments

Comments

@timotheecour
Copy link
Member

timotheecour commented Jun 16, 2021

after a painful reduction from the seemingly uncomprehensible CI failure in #18274, I reduced it to this:

Example 1

when true:
  macro `&`(pattern: static string): untyped = discard
  var zook: string
  var x: string
  let s = x & "bar"
  import t12408c # content doesn't matter, can be empty

nim e main.nim

Current Output

Error: cannot evaluate at compile time: zook

Expected Output

works

Example 2

ditto

when true:
  proc `&`(pattern: static float) = discard
  var zook: string
  let s = `&`(zook, "bar")
  import t12408c # content doesn't matter, can be empty

Example 3

ditto

when true:
  proc bar(pattern: static float) = discard
  proc bar(a, b: int) = discard
  var gook: int
  bar(gook, 2)
  import t12408c # content doesn't matter, can be empty

Additional Information

1.5.1 e80d7ff
no error if you change things eg:

  • removing the import
  • moving some code inside a proc
  • seems to affect nimscript only, not VM, in particular this does work:
  proc bar(pattern: static float) = discard
  proc bar(a, b: int) = discard
  static:
    var gook: int
    bar(gook, 2)
  import t12408c # content doesn't matter, can be empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant