fix #14339, #13511, #14420: fixes limited VM support for addr (#16002)

* fix #14339: fixes limited VM support for addr

* strengthen test

* reference bug #16003

* also fixes #13511

* also fixes #14420
This commit is contained in:
Timothee Cour 2020-11-25 11:48:10 -08:00 • committed by GitHub
commit 3e7077ac7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 160 additions and 44 deletions

View file

@ -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)