Skip to content

Commit

Permalink
also fixes nim-lang#13511
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Nov 25, 2020
1 parent dffafdb commit e022e67
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/macros/tmacros_various.nim
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,28 @@ xbenchmark:
discard inputtest
fastSHA("hey")


block: # bug #13511
type
Builder = ref object
components: seq[Component]
Component = object

proc add(builder: var Builder, component: Component) {.compileTime.} =
builder.components.add(component)

macro debugAst(arg: typed): untyped =
## just for debugging purpose.
discard arg.treeRepr
return arg

static:
var component = Component()
var builder = Builder()

template foo(): untyped =
## WAS: this doc comment causes compilation failure.
builder

debugAst:
add(foo(), component)

0 comments on commit e022e67

Please sign in to comment.