mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
@@ -2044,6 +2044,7 @@ proc upConv(p: BProc, n: PNode, d: var TLoc) =
|
||||
if t.kind notin {tyVar, tyLent} or not p.module.compileToCpp:
|
||||
r = "(*$1)" % [r]
|
||||
t = skipTypes(t.lastSon, abstractInst)
|
||||
discard getTypeDesc(p.module, t)
|
||||
if not p.module.compileToCpp:
|
||||
while t.kind == tyObject and t.sons[0] != nil:
|
||||
add(r, ".Sup")
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
type
|
||||
MyRefObject* = ref object
|
||||
s: string
|
||||
|
||||
|
||||
BaseObj* = ref object of RootObj
|
||||
ChildObj* = ref object of BaseObj
|
||||
|
||||
proc newMyRefObject*(s: string): MyRefObject =
|
||||
new(result)
|
||||
|
||||
@@ -27,3 +27,8 @@ proc f(foo: ptr Foo, foo2: ptr Foo2): cint =
|
||||
if foo2 != nil: {.emit: [result, " = ", foo2[], ".b;"].}
|
||||
|
||||
discard f(nil, nil)
|
||||
|
||||
|
||||
# bug #7392
|
||||
var x1: BaseObj
|
||||
var x2 = ChildObj(x1)
|
||||
|
||||
Reference in New Issue
Block a user