Nim does allow importing fields with specific names. So you could rename the
field `typ` or `kind`. As the following does.
type
AType {.importc: "AType", header: "somewhere.h".} = object
kind {.importc: "type".}: cint # could also name this `typ`
another: cint
...
var t: AType
t.kind = 1
t.another = 2
Run
- Import C and Nim keyword collisions RodSteward
- Import C and Nim keyword collisions juancarlospaco
- Import C and Nim keyword collisions ElegantBeef
