tsizeof2.nim 271 B

123456789101112131415161718
  1. discard """
  2. errormsg: "'sizeof' requires '.importc' types to be '.completeStruct'"
  3. line: 9
  4. """
  5. type
  6. MyStruct {.importc: "MyStruct".} = object
  7. const i = sizeof(MyStruct)
  8. echo i
  9. # bug #9868
  10. proc foo(a: SomeInteger): array[sizeof(a), byte] =
  11. discard
  12. discard foo(1)