Skip to content

invalid pragma for var pragmas inside templates #89

@timotheecour

Description

@timotheecour

invalid pragma for var pragmas inside templates

Example

template foo(lhs, typ, expr) =
  let lhs = expr
proc fun1()=
  let a {.foo.} = 1
template fun2()=
  let a {.foo.} = 1
fun1() # ok
fun2() # BUG

Current Output

Error: invalid pragma: foo

Expected Output

works

Additional Information

nim 7e83adf
related: #129
=> template/macro pragmas don't work in templates (eg: byaddr, since etc) · Issue #15920 · nim-lang/Nim

workaround:

let a {.foo.} = 1
=>
foo(a, nil, 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions