-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Test case
type
Helper* {.exportc: "PublicHelper".} = object
case isKind: bool
of true:
formatted: string
of false:
parsed1: string
parsed2: string
proc test(c: Helper): string =
c.formatted
echo test(Helper(isKind: true, formatted: "ok"))On latest Nim generated C fails to compile with error:
Error: execution of an external compiler program 'gcc.exe -c -w -mno-ms-bitfields -IC:\Nim\lib -IC:\Nim -o "C:\t1_d\@mt1.nim.c.o" "C:\t1_d\@mt1.nim.c"' failed with exit code: 1
C:\t1_d\@mt1.nim.c: In function 'test__cf7ypsLB70bFkcUMOU1MAg':
C:\t1_d\@mt1.nim.c:120:23: error: 'PublicHelper' {aka 'struct PublicHelper'} has no member named 'formatted'
result = copyString(c.formatted);
Compiles fine without exportc pragma
I have a fix