parent
afb8b69c0a
commit
1d14b2c9e6
2 changed files with 20 additions and 1 deletions
|
|
@ -1278,7 +1278,8 @@ proc typeSectionRightSidePass(c: PContext, n: PNode) =
|
||||||
incl st.flags, tfRefsAnonObj
|
incl st.flags, tfRefsAnonObj
|
||||||
let obj = newSym(skType, getIdent(c.cache, s.name.s & ":ObjectType"),
|
let obj = newSym(skType, getIdent(c.cache, s.name.s & ":ObjectType"),
|
||||||
nextId c.idgen, getCurrOwner(c), s.info)
|
nextId c.idgen, getCurrOwner(c), s.info)
|
||||||
obj.ast = a
|
obj.ast = a.copyTree
|
||||||
|
obj.ast[0] = newSymNode(obj)
|
||||||
if sfPure in s.flags:
|
if sfPure in s.flags:
|
||||||
obj.flags.incl sfPure
|
obj.flags.incl sfPure
|
||||||
obj.typ = st.lastSon
|
obj.typ = st.lastSon
|
||||||
|
|
|
||||||
|
|
@ -65,3 +65,21 @@ macro check_gen_proc(ex: typed): (bool, bool) =
|
||||||
let a = @[1,2,3]
|
let a = @[1,2,3]
|
||||||
assert: check_gen_proc(len(a)) == (false, true)
|
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[]))
|
||||||
Loading…
Add table
Add a link
Reference in a new issue