tsizeof2.nim 280 B

123456789101112131415161718
  1. discard """
  2. errormsg: "cannot evaluate 'sizeof' because its type is not defined completely"
  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)