fixes #11747
This commit is contained in:
parent
102b71f42e
commit
15d2a92be0
2 changed files with 17 additions and 0 deletions
|
|
@ -1414,6 +1414,9 @@ proc semDeref(c: PContext, n: PNode): PNode =
|
||||||
var t = skipTypes(n.sons[0].typ, {tyGenericInst, tyVar, tyLent, tyAlias, tySink, tyOwned})
|
var t = skipTypes(n.sons[0].typ, {tyGenericInst, tyVar, tyLent, tyAlias, tySink, tyOwned})
|
||||||
case t.kind
|
case t.kind
|
||||||
of tyRef, tyPtr: n.typ = t.lastSon
|
of tyRef, tyPtr: n.typ = t.lastSon
|
||||||
|
of tyTypeDesc:
|
||||||
|
# typeof(x[]) is still a typedesc:
|
||||||
|
n.typ = makeTypeDesc(c, t.lastSon.lastSon)
|
||||||
else: result = nil
|
else: result = nil
|
||||||
#GlobalError(n.sons[0].info, errCircumNeedsPointer)
|
#GlobalError(n.sons[0].info, errCircumNeedsPointer)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ proc Child
|
||||||
method Base
|
method Base
|
||||||
yield Base
|
yield Base
|
||||||
yield Child
|
yield Child
|
||||||
|
12
|
||||||
'''
|
'''
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -27,3 +28,16 @@ when false:
|
||||||
|
|
||||||
for s in Base.it: echo s
|
for s in Base.it: echo s
|
||||||
for s in Child.it: echo s #<- bug #2662
|
for s in Child.it: echo s #<- bug #2662
|
||||||
|
|
||||||
|
|
||||||
|
# bug #11747
|
||||||
|
|
||||||
|
type
|
||||||
|
MyType = object
|
||||||
|
a: int32
|
||||||
|
b: int32
|
||||||
|
c: int32
|
||||||
|
|
||||||
|
MyRefType = ref MyType
|
||||||
|
|
||||||
|
echo sizeof(MyRefType[])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue