mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
* -d:checkabi obsolete (ABI check now enforced); add `addTypeHeader` helper
* cleanups
* import sizeof at CT for {.completeType.}
* address comments; revert default enabling of -d:checkAbi for now
* mimportc_size_check.nim => msizeof5.nim; merge mabi_check.nim into msizeof5.nim; refactor
* all pragmas in errmsgs should be written: '.importc' (un-ambiguous and less verbose than {.importc.})
18 lines
271 B
Nim
18 lines
271 B
Nim
discard """
|
|
errormsg: "'sizeof' requires '.importc' types to be '.completeStruct'"
|
|
line: 9
|
|
"""
|
|
|
|
type
|
|
MyStruct {.importc: "MyStruct".} = object
|
|
|
|
const i = sizeof(MyStruct)
|
|
|
|
echo i
|
|
|
|
# bug #9868
|
|
proc foo(a: SomeInteger): array[sizeof(a), byte] =
|
|
discard
|
|
|
|
discard foo(1)
|