Maybe you need:
type
Parent {.importc, nodecl.} = object
x: cint
Child {.importc, nodecl.} = object
base: Parent
y: int
var c: Child
echo c.base.x
let p = cast[ptr Parent](addr c)
Run
- How to prevent nim generate C code access parent type through `Sup... sls1005
