parent
a0b547001b
commit
e2c2ae8e7e
3 changed files with 9 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue