Skip to content

Templates: Calling templates from templates with other complications fails #110

@dom96

Description

@dom96
template something(blah: string, extraStuff: int, b: stmt): stmt =
  block:
    var something = (proc (): bool =
                       b
                       result = false)

template test(blah: string, b: stmt): stmt =
  something(blah, 675, b)

when isMainModule:
  test "blah":
    echo("sahda")

The following code fails with:


templateintemplate.nim(12, 6) Info: instantiation from here
templateintemplate.nim(13, 4) Error: invalid expression: '
  echo("sahda")'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions