ttypeinfo1.nim 279 B

12345678910111213141516171819202122
  1. discard """
  2. targets: "cpp"
  3. output: '''100'''
  4. """
  5. import typeinfo
  6. #bug #6016
  7. type
  8. Onion {.union.} = object
  9. field1: int
  10. field2: uint64
  11. Stroom = Onion
  12. PStroom = ptr Stroom
  13. proc pstruct(u: PStroom) =
  14. echo u.field2
  15. var x = Onion(field1: 100)
  16. pstruct(x.addr)