This commit is contained in:
cooldome 2020-11-24 14:49:14 +00:00 • committed by GitHub
commit 1d14b2c9e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View file

@ -65,3 +65,21 @@ macro check_gen_proc(ex: typed): (bool, bool) =
let a = @[1,2,3]
assert: check_gen_proc(len(a)) == (false, true)
#---------------------------------------------------------------
# issue #16110
macro check(x: type): untyped =
let z = getType(x)
let y = getImpl(z[1])
echo z.treeRepr
expectKind(z[1], nnkSym)
expectKind(y[0], nnkSym)
doAssert(y[0] == z[1])
type
TirePtr = ptr object
code: int
var z: TirePtr
check(typeof(z[]))