nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.46k stars 1.47k forks source link

Union Object Initializer ```error: extra brace group at end of initializer``` #20653

Open LukeDeWaal opened 1 year ago

LukeDeWaal commented 1 year ago

What happened?

I have encountered this issue (#10815) or something related in my project with the following example code:

type
  EmptySeq* {.bycopy.} = object

  ChoiceWithEmptySeq_d* {.bycopy.} = object
    a*: bool

  INNER_C_UNION* {.bycopy, union.} = object
    a*: char
    b*: EmptySeq
    c*: byte
    d*: ChoiceWithEmptySeq_d

  ChoiceWithEmptySeq_selection* = enum
    ChoiceWithEmptySeq_NONE, 
    ChoiceWithEmptySeq_a_PRESENT,
    ChoiceWithEmptySeq_b_PRESENT,  
    ChoiceWithEmptySeq_c_PRESENT,
    ChoiceWithEmptySeq_d_PRESENT

  ChoiceWithEmptySeq* {.bycopy.} = object
    kind*: ChoiceWithEmptySeq_selection
    u*: INNER_C_UNION

  Og_Context* {.bycopy.} = object
    state*: int
    init_done*: bool
    ch*: ChoiceWithEmptySeq
    em*: EmptySeq

var context* : Og_Context = Og_Context(init_done: false)

The generated C code attempts to initialize the Object as: {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} while it should in fact be: {0, NIM_FALSE, {0, 0}, {}}. It tries to populate the Union as if it is a regular object, while it should only initialize a single field.

This bug does not occur when manually initializing the Union:

var context* : Og_Context = Og_Context(init_done: false, 
                                       ch: ChoiceWithEmptySeq(kind: ChoiceWithEmptySeq_a_PRESENT, 
                                                              u: INNER_C_UNION(a: '\0')))

Nim Version

Nim Compiler Version 1.6.8 [Linux: amd64] Compiled at 2022-09-27 Copyright (c) 2006-2021 by Andreas Rumpf

git hash: c9f46ca8c9eeca8b5f68591b1abe14b962f80a4c active boot switches: -d:release

Current Standard Output Logs

/home/runner/.cache/nim/main_d/@mmain.nim.c:58:117: error: extra brace group at end of initializer
 text__HGn2aXle70F1hKpo8FMikg = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}}
                                                       ^
/home/runner/.cache/nim/main_d/@mmain.nim.c:58:117: note: (near initialization for ‘context__HGn2aXle70F1hKpo8FMikg.ch.u’)
/home/runner/.cache/nim/main_d/@mmain.nim.c:58:124: error: extra brace group at end of initializer
 Gn2aXle70F1hKpo8FMikg = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}}
                                                       ^
/home/runner/.cache/nim/main_d/@mmain.nim.c:58:124: note: (near initialization for ‘context__HGn2aXle70F1hKpo8FMikg.ch.u’)
Error: execution of an external compiler program 'gcc -c  -w   -I/usr/local/lib/nim -I/home/runner/ttv0abnzej -o /home/runner/.cache/nim/main_d/@mmain.nim.c.o /home/runner/.cache/nim/main_d/@mmain.nim.c' failed with exit code: 1

Additional Information

Related Issue: #10815 Platform: Linux Debian 11
(Kernel Version: 5.10.0-17-amd64)

kdeme commented 3 months ago

I've been hitting a similar issue in our nim-eth code base.

Minimized (does still use chronos) code snippit:


import chronos

type
  Socket* = object
    a*: int

  ErrorType* = enum
    ErrorA, ErrorB

  Error* = object
    case kind*: ErrorType
    of ErrorA:
      discard
    of ErrorB:
      discard

proc connect(s: Socket): Future[Error] {.async: (raises: [CancelledError]).} =
  discard

let socket = Socket(a: 123)
let res = waitFor socket.connect()

Compiles fine with Nim 1.6.20:

Nim Compiler Version 1.6.20 [Linux: amd64]
Compiled at 2024-04-07
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 19fdbfc173bfccb64cb64e0a963e69f52f71fc73
active boot switches: -d:release

With Nim devel or 2.0.4

/home/deme/.cache/nim/extra_brace_d/@m..@s..@s.nimble@spkgs2@schronos-4.0.2-c736ec5b800fa8df7cf1be9da918578bd5e173d2@schronos@sinternal@sasyncfutures.nim.c:316:266: error: extra brace group at end of initializer
  316 | tuidRCk31w_6 = {{{{{(&NTIv2__1go9brEQ7Per5SINHtx3UOw_)}, {NIM_NIL, NIM_NIL}, {0, NIM_NIL}, {NIM_NIL, NIM_NIL}, NIM_NIL, 0, 0, NIM_NIL, {NIM_NIL, NIM_NIL}}}, {0, {}}}, {}}
      |                                                                                                                                                                  ^

/home/deme/.cache/nim/extra_brace_d/@m..@s..@s.nimble@spkgs2@schronos-4.0.2-c736ec5b800fa8df7cf1be9da918578bd5e173d2@schronos@sinternal@sasyncfutures.nim.c:316:266: note: (near initialization for ‘TM__qMFlZYKlAiPttuidRCk31w_6.Sup.internalValue’)
Error: execution of an external compiler program 'gcc -c  -w -fmax-errors=3 -pthread   -I'/home/deme/.choosenim/toolchains/nim-#devel/lib' -I/home/deme/repos/nim-eth -o /home/deme/.cache/nim/extra_brace_d/@m..@s..@s.nimble@spkgs2@schronos-4.0.2-c736ec5b800fa8df7cf1be9da918578bd5e173d2@schronos@sinternal@sasyncfutures.nim.c.o /home/deme/.cache/nim/extra_brace_d/@m..@s..@s.nimble@spkgs2@schronos-4.0.2-c736ec5b800fa8df7cf1be9da918578bd5e173d2@schronos@sinternal@sasyncfutures.nim.c' failed with exit code: 1

Nim devel:

Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2024-06-10
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 56c95758b2777a36c8608a7b9950ba5ce8ce0b65
active boot switches: -d:release

Nim 2.0.4:

Nim Compiler Version 2.0.4 [Linux: amd64]
Compiled at 2024-03-28
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: b47747d31844c6bd9af4322efe55e24fefea544c
active boot switches: -d:release

nim-chronos revision: 7630f394718ebcdb8577e36faacd78cb7a0b7dd6

Note that not using the object variant but instead directly the ErrorType makes the compiling succeed.

juancarlospaco commented 3 months ago

!nim c

type
  EmptySeq* {.bycopy.} = object

  ChoiceWithEmptySeq_d* {.bycopy.} = object
    a*: bool

  INNER_C_UNION* {.bycopy, union.} = object
    a*: char
    b*: EmptySeq
    c*: byte
    d*: ChoiceWithEmptySeq_d

  ChoiceWithEmptySeq_selection* = enum
    ChoiceWithEmptySeq_NONE, 
    ChoiceWithEmptySeq_a_PRESENT,
    ChoiceWithEmptySeq_b_PRESENT,  
    ChoiceWithEmptySeq_c_PRESENT,
    ChoiceWithEmptySeq_d_PRESENT

  ChoiceWithEmptySeq* {.bycopy.} = object
    kind*: ChoiceWithEmptySeq_selection
    u*: INNER_C_UNION

  Og_Context* {.bycopy.} = object
    state*: int
    init_done*: bool
    ch*: ChoiceWithEmptySeq
    em*: EmptySeq

var context* : Og_Context = Og_Context(init_done: false)
github-actions[bot] commented 3 months ago
:penguin: Linux bisect by @juancarlospaco (collaborator)
devel :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/@mtemp.nim.c:52:102: error: extra brace group at end of initializer 52 | N_LIB_PRIVATE tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg context__temp_u26 = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} | ^ /home/runner/work/Nim/Nim/@mtemp.nim.c:52:102: note: (near initialization for ‘context__temp_u26.ch.u’) /home/runner/work/Nim/Nim/@mtemp.nim.c:52:109: error: extra brace group at end of initializer 52 | N_LIB_PRIVATE tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg context__temp_u26 = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} | ^ /home/runner/work/Nim/Nim/@mtemp.nim.c:52:109: note: (near initialization for ‘context__temp_u26.ch.u’) Error: execution of an external compiler program 'gcc -c -w -fmax-errors=3 -pthread -I'/home/runner/.choosenim/toolchains/nim-#devel/lib' -I/home/runner/work/Nim/Nim -o /home/runner/work/Nim/Nim/@mtemp.nim.c.o /home/runner/work/Nim/Nim/@mtemp.nim.c' failed with exit code: 1 assertions.nim(34) raiseAssert Error: unhandled exception: errGenerated [AssertionDefect] ```

IR

Compiled filesize 0 (0 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" typedef struct tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg; typedef struct tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw; typedef union tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w; typedef struct tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw; typedef struct tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig; typedef NU8 tyEnum_ChoiceWithEmptySeq_selection__y0C05wPaCBrO9acY9aRJcUTg; struct tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw { char dummy; }; struct tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig { NIM_BOOL a; }; union tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w { NIM_CHAR a; tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw b; NU8 c; tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig d; }; struct tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw { tyEnum_ChoiceWithEmptySeq_selection__y0C05wPaCBrO9acY9aRJcUTg kind; tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w u; }; struct tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg { NI state; NIM_BOOL init_done; tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw ch; tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw em; }; N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); N_LIB_PRIVATE tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg context__temp_u26 = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} ; N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimTestErrorFlag(); } } ```

Stats

  • Started 2024-06-11T10:27:30
  • Finished 2024-06-11T10:27:30
  • Duration

AST

```nim nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("EmptySeq") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), newEmptyNode() ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq_d") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("a") ), newIdentNode("bool"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("INNER_C_UNION") ), nnkPragma.newTree( newIdentNode("bycopy"), newIdentNode("union") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("a") ), newIdentNode("char"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("b") ), newIdentNode("EmptySeq"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("c") ), newIdentNode("byte"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("d") ), newIdentNode("ChoiceWithEmptySeq_d"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq_selection") ), newEmptyNode(), nnkEnumTy.newTree( newEmptyNode(), newIdentNode("ChoiceWithEmptySeq_NONE"), newIdentNode("ChoiceWithEmptySeq_a_PRESENT"), newIdentNode("ChoiceWithEmptySeq_b_PRESENT"), newIdentNode("ChoiceWithEmptySeq_c_PRESENT"), newIdentNode("ChoiceWithEmptySeq_d_PRESENT") ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("kind") ), newIdentNode("ChoiceWithEmptySeq_selection"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("u") ), newIdentNode("INNER_C_UNION"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("Og_Context") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("state") ), newIdentNode("int"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("init_done") ), newIdentNode("bool"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ch") ), newIdentNode("ChoiceWithEmptySeq"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("em") ), newIdentNode("EmptySeq"), newEmptyNode() ) ) ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("context") ), newIdentNode("Og_Context"), nnkObjConstr.newTree( newIdentNode("Og_Context"), nnkExprColonExpr.newTree( newIdentNode("init_done"), newIdentNode("false") ) ) ) ) ) ```
stable :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/@mtemp.nim.c:52:102: error: extra brace group at end of initializer 52 | N_LIB_PRIVATE tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg context__temp_u26 = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} | ^ /home/runner/work/Nim/Nim/@mtemp.nim.c:52:102: note: (near initialization for ‘context__temp_u26.ch.u’) /home/runner/work/Nim/Nim/@mtemp.nim.c:52:109: error: extra brace group at end of initializer 52 | N_LIB_PRIVATE tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg context__temp_u26 = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} | ^ /home/runner/work/Nim/Nim/@mtemp.nim.c:52:109: note: (near initialization for ‘context__temp_u26.ch.u’) Error: execution of an external compiler program 'gcc -c -w -fmax-errors=3 -pthread -I/home/runner/.choosenim/toolchains/nim-2.0.4/lib -I/home/runner/work/Nim/Nim -o /home/runner/work/Nim/Nim/@mtemp.nim.c.o /home/runner/work/Nim/Nim/@mtemp.nim.c' failed with exit code: 1 assertions.nim(34) raiseAssert Error: unhandled exception: options.nim(681, 5) `false` errGenerated [AssertionDefect] ```

IR

Compiled filesize 0 (0 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" typedef struct tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg; typedef struct tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw; typedef union tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w; typedef struct tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw; typedef struct tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig; typedef NU8 tyEnum_ChoiceWithEmptySeq_selection__y0C05wPaCBrO9acY9aRJcUTg; struct tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw { char dummy; }; struct tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig { NIM_BOOL a; }; union tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w { NIM_CHAR a; tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw b; NU8 c; tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig d; }; struct tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw { tyEnum_ChoiceWithEmptySeq_selection__y0C05wPaCBrO9acY9aRJcUTg kind; tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w u; }; struct tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg { NI state; NIM_BOOL init_done; tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw ch; tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw em; }; N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot4atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); N_LIB_PRIVATE tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg context__temp_u26 = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} ; N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot4atslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot4atslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimTestErrorFlag(); } } ```

Stats

  • Started 2024-06-11T10:27:31
  • Finished 2024-06-11T10:27:31
  • Duration

AST

```nim nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("EmptySeq") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), newEmptyNode() ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq_d") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("a") ), newIdentNode("bool"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("INNER_C_UNION") ), nnkPragma.newTree( newIdentNode("bycopy"), newIdentNode("union") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("a") ), newIdentNode("char"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("b") ), newIdentNode("EmptySeq"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("c") ), newIdentNode("byte"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("d") ), newIdentNode("ChoiceWithEmptySeq_d"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq_selection") ), newEmptyNode(), nnkEnumTy.newTree( newEmptyNode(), newIdentNode("ChoiceWithEmptySeq_NONE"), newIdentNode("ChoiceWithEmptySeq_a_PRESENT"), newIdentNode("ChoiceWithEmptySeq_b_PRESENT"), newIdentNode("ChoiceWithEmptySeq_c_PRESENT"), newIdentNode("ChoiceWithEmptySeq_d_PRESENT") ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("kind") ), newIdentNode("ChoiceWithEmptySeq_selection"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("u") ), newIdentNode("INNER_C_UNION"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("Og_Context") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("state") ), newIdentNode("int"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("init_done") ), newIdentNode("bool"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ch") ), newIdentNode("ChoiceWithEmptySeq"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("em") ), newIdentNode("EmptySeq"), newEmptyNode() ) ) ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("context") ), newIdentNode("Og_Context"), nnkObjConstr.newTree( newIdentNode("Og_Context"), nnkExprColonExpr.newTree( newIdentNode("init_done"), newIdentNode("false") ) ) ) ) ) ```
2.0.4 :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/@mtemp.nim.c:52:102: error: extra brace group at end of initializer 52 | N_LIB_PRIVATE tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg context__temp_u26 = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} | ^ /home/runner/work/Nim/Nim/@mtemp.nim.c:52:102: note: (near initialization for ‘context__temp_u26.ch.u’) /home/runner/work/Nim/Nim/@mtemp.nim.c:52:109: error: extra brace group at end of initializer 52 | N_LIB_PRIVATE tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg context__temp_u26 = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} | ^ /home/runner/work/Nim/Nim/@mtemp.nim.c:52:109: note: (near initialization for ‘context__temp_u26.ch.u’) Error: execution of an external compiler program 'gcc -c -w -fmax-errors=3 -pthread -I/home/runner/.choosenim/toolchains/nim-2.0.4/lib -I/home/runner/work/Nim/Nim -o /home/runner/work/Nim/Nim/@mtemp.nim.c.o /home/runner/work/Nim/Nim/@mtemp.nim.c' failed with exit code: 1 assertions.nim(34) raiseAssert Error: unhandled exception: options.nim(681, 5) `false` errGenerated [AssertionDefect] ```

IR

Compiled filesize 0 (0 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" typedef struct tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg; typedef struct tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw; typedef union tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w; typedef struct tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw; typedef struct tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig; typedef NU8 tyEnum_ChoiceWithEmptySeq_selection__y0C05wPaCBrO9acY9aRJcUTg; struct tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw { char dummy; }; struct tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig { NIM_BOOL a; }; union tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w { NIM_CHAR a; tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw b; NU8 c; tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig d; }; struct tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw { tyEnum_ChoiceWithEmptySeq_selection__y0C05wPaCBrO9acY9aRJcUTg kind; tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w u; }; struct tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg { NI state; NIM_BOOL init_done; tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw ch; tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw em; }; N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot4atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); N_LIB_PRIVATE tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg context__temp_u26 = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} ; N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot4atslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot4atslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimTestErrorFlag(); } } ```

Stats

  • Started 2024-06-11T10:27:32
  • Finished 2024-06-11T10:27:32
  • Duration

AST

```nim nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("EmptySeq") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), newEmptyNode() ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq_d") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("a") ), newIdentNode("bool"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("INNER_C_UNION") ), nnkPragma.newTree( newIdentNode("bycopy"), newIdentNode("union") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("a") ), newIdentNode("char"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("b") ), newIdentNode("EmptySeq"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("c") ), newIdentNode("byte"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("d") ), newIdentNode("ChoiceWithEmptySeq_d"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq_selection") ), newEmptyNode(), nnkEnumTy.newTree( newEmptyNode(), newIdentNode("ChoiceWithEmptySeq_NONE"), newIdentNode("ChoiceWithEmptySeq_a_PRESENT"), newIdentNode("ChoiceWithEmptySeq_b_PRESENT"), newIdentNode("ChoiceWithEmptySeq_c_PRESENT"), newIdentNode("ChoiceWithEmptySeq_d_PRESENT") ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("kind") ), newIdentNode("ChoiceWithEmptySeq_selection"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("u") ), newIdentNode("INNER_C_UNION"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("Og_Context") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("state") ), newIdentNode("int"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("init_done") ), newIdentNode("bool"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ch") ), newIdentNode("ChoiceWithEmptySeq"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("em") ), newIdentNode("EmptySeq"), newEmptyNode() ) ) ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("context") ), newIdentNode("Og_Context"), nnkObjConstr.newTree( newIdentNode("Og_Context"), nnkExprColonExpr.newTree( newIdentNode("init_done"), newIdentNode("false") ) ) ) ) ) ```
2.0.0 :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/@mtemp.nim.c:52:102: error: extra brace group at end of initializer 52 | N_LIB_PRIVATE tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg context__temp_u26 = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} | ^ /home/runner/work/Nim/Nim/@mtemp.nim.c:52:102: note: (near initialization for ‘context__temp_u26.ch.u’) /home/runner/work/Nim/Nim/@mtemp.nim.c:52:109: error: extra brace group at end of initializer 52 | N_LIB_PRIVATE tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg context__temp_u26 = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} | ^ /home/runner/work/Nim/Nim/@mtemp.nim.c:52:109: note: (near initialization for ‘context__temp_u26.ch.u’) Error: execution of an external compiler program 'gcc -c -w -fmax-errors=3 -pthread -I/home/runner/.choosenim/toolchains/nim-2.0.0/lib -I/home/runner/work/Nim/Nim -o /home/runner/work/Nim/Nim/@mtemp.nim.c.o /home/runner/work/Nim/Nim/@mtemp.nim.c' failed with exit code: 1 assertions.nim(34) raiseAssert Error: unhandled exception: options.nim(664, 5) `false` errGenerated [AssertionDefect] ```

IR

Compiled filesize 0 (0 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" typedef struct tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg; typedef struct tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw; typedef union tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w; typedef struct tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw; typedef struct tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig; typedef NU8 tyEnum_ChoiceWithEmptySeq_selection__y0C05wPaCBrO9acY9aRJcUTg; struct tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw { char dummy; }; struct tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig { NIM_BOOL a; }; union tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w { NIM_CHAR a; tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw b; NU8 c; tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig d; }; struct tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw { tyEnum_ChoiceWithEmptySeq_selection__y0C05wPaCBrO9acY9aRJcUTg kind; tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w u; }; struct tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg { NI state; NIM_BOOL init_done; tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw ch; tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw em; }; N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); N_LIB_PRIVATE tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg context__temp_u26 = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} ; N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimTestErrorFlag(); } } ```

Stats

  • Started 2024-06-11T10:27:36
  • Finished 2024-06-11T10:27:36
  • Duration

AST

```nim nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("EmptySeq") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), newEmptyNode() ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq_d") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("a") ), newIdentNode("bool"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("INNER_C_UNION") ), nnkPragma.newTree( newIdentNode("bycopy"), newIdentNode("union") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("a") ), newIdentNode("char"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("b") ), newIdentNode("EmptySeq"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("c") ), newIdentNode("byte"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("d") ), newIdentNode("ChoiceWithEmptySeq_d"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq_selection") ), newEmptyNode(), nnkEnumTy.newTree( newEmptyNode(), newIdentNode("ChoiceWithEmptySeq_NONE"), newIdentNode("ChoiceWithEmptySeq_a_PRESENT"), newIdentNode("ChoiceWithEmptySeq_b_PRESENT"), newIdentNode("ChoiceWithEmptySeq_c_PRESENT"), newIdentNode("ChoiceWithEmptySeq_d_PRESENT") ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("kind") ), newIdentNode("ChoiceWithEmptySeq_selection"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("u") ), newIdentNode("INNER_C_UNION"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("Og_Context") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("state") ), newIdentNode("int"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("init_done") ), newIdentNode("bool"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ch") ), newIdentNode("ChoiceWithEmptySeq"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("em") ), newIdentNode("EmptySeq"), newEmptyNode() ) ) ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("context") ), newIdentNode("Og_Context"), nnkObjConstr.newTree( newIdentNode("Og_Context"), nnkExprColonExpr.newTree( newIdentNode("init_done"), newIdentNode("false") ) ) ) ) ) ```
1.6.20 :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/@mtemp.nim.c:56:102: error: extra brace group at end of initializer 56 | N_LIB_PRIVATE tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg context__temp_u26 = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} | ^ /home/runner/work/Nim/Nim/@mtemp.nim.c:56:102: note: (near initialization for ‘context__temp_u26.ch.u’) /home/runner/work/Nim/Nim/@mtemp.nim.c:56:109: error: extra brace group at end of initializer 56 | N_LIB_PRIVATE tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg context__temp_u26 = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} | ^ /home/runner/work/Nim/Nim/@mtemp.nim.c:56:109: note: (near initialization for ‘context__temp_u26.ch.u’) Error: execution of an external compiler program 'gcc -c -w -fmax-errors=3 -I/home/runner/.choosenim/toolchains/nim-1.6.20/lib -I/home/runner/work/Nim/Nim -o /home/runner/work/Nim/Nim/@mtemp.nim.c.o /home/runner/work/Nim/Nim/@mtemp.nim.c' failed with exit code: 1 fatal.nim(54) sysFatal Error: unhandled exception: options.nim(662, 14) `false` errGenerated [AssertionDefect] ```

IR

Compiled filesize 0 (0 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #define nimfr_(x, y) #define nimln_(x, y) typedef struct tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg; typedef struct tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw; typedef union tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w; typedef struct tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw; typedef struct tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig; typedef NU8 tyEnum_ChoiceWithEmptySeq_selection__y0C05wPaCBrO9acY9aRJcUTg; struct tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw { char dummy; }; struct tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig { NIM_BOOL a; }; union tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w { NIM_CHAR a; tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw b; NU8 c; tyObject_ChoiceWithEmptySeq_d__1rjgffnmmHGRUJ6ksfwyig d; }; struct tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw { tyEnum_ChoiceWithEmptySeq_selection__y0C05wPaCBrO9acY9aRJcUTg kind; tyObject_INNER_C_UNION__Ho3EQWBn9bl11Djiv0non1w u; }; struct tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg { NI state; NIM_BOOL init_done; tyObject_ChoiceWithEmptySeq__yAlpvnU3jHGuUtW7YazlKw ch; tyObject_EmptySeq__JEPYwSJUh7lAEOb4O7XoJw em; }; static N_INLINE(void, initStackBottomWith)(void* locals); N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); N_LIB_PRIVATE tyObject_Og_Context__1ZMSeuDcwNvPj6VrWwfiLg context__temp_u26 = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} ; static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000(); initStackBottomWith((void *)&inner); atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000(); (*inner)(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { } } ```

Stats

  • Started 2024-06-11T10:27:39
  • Finished 2024-06-11T10:27:40
  • Duration

AST

```nim nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("EmptySeq") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), newEmptyNode() ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq_d") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("a") ), newIdentNode("bool"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("INNER_C_UNION") ), nnkPragma.newTree( newIdentNode("bycopy"), newIdentNode("union") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("a") ), newIdentNode("char"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("b") ), newIdentNode("EmptySeq"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("c") ), newIdentNode("byte"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("d") ), newIdentNode("ChoiceWithEmptySeq_d"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq_selection") ), newEmptyNode(), nnkEnumTy.newTree( newEmptyNode(), newIdentNode("ChoiceWithEmptySeq_NONE"), newIdentNode("ChoiceWithEmptySeq_a_PRESENT"), newIdentNode("ChoiceWithEmptySeq_b_PRESENT"), newIdentNode("ChoiceWithEmptySeq_c_PRESENT"), newIdentNode("ChoiceWithEmptySeq_d_PRESENT") ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("kind") ), newIdentNode("ChoiceWithEmptySeq_selection"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("u") ), newIdentNode("INNER_C_UNION"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("Og_Context") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("state") ), newIdentNode("int"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("init_done") ), newIdentNode("bool"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ch") ), newIdentNode("ChoiceWithEmptySeq"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("em") ), newIdentNode("EmptySeq"), newEmptyNode() ) ) ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("context") ), newIdentNode("Og_Context"), nnkObjConstr.newTree( newIdentNode("Og_Context"), nnkExprColonExpr.newTree( newIdentNode("init_done"), newIdentNode("false") ) ) ) ) ) ```
1.4.8 :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/@mtemp.nim.c:70:117: error: extra brace group at end of initializer 70 | N_LIB_PRIVATE tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew context__eZjCef5qtZfly1K38Gq64Q = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} | ^ /home/runner/work/Nim/Nim/@mtemp.nim.c:70:117: note: (near initialization for ‘context__eZjCef5qtZfly1K38Gq64Q.ch.u’) /home/runner/work/Nim/Nim/@mtemp.nim.c:70:124: error: extra brace group at end of initializer 70 | N_LIB_PRIVATE tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew context__eZjCef5qtZfly1K38Gq64Q = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} | ^ /home/runner/work/Nim/Nim/@mtemp.nim.c:70:124: note: (near initialization for ‘context__eZjCef5qtZfly1K38Gq64Q.ch.u’) Error: execution of an external compiler program 'gcc -c -w -fmax-errors=3 -I/home/runner/.choosenim/toolchains/nim-1.4.8/lib -I/home/runner/work/Nim/Nim -o /home/runner/work/Nim/Nim/@mtemp.nim.c.o /home/runner/work/Nim/Nim/@mtemp.nim.c' failed with exit code: 1 ```

IR

Compiled filesize 0 (0 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #define nimfr_(x, y) #define nimln_(x, y) typedef struct tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew; typedef struct tyObject_ChoiceWithEmptySeq__t7AEMm29aSJZlarP2nlNXPg tyObject_ChoiceWithEmptySeq__t7AEMm29aSJZlarP2nlNXPg; typedef union tyObject_INNER_C_UNION__nSy3jrICR0lkSmOVKZWCMw tyObject_INNER_C_UNION__nSy3jrICR0lkSmOVKZWCMw; typedef struct tyObject_EmptySeq__uQOC49aSxZzQKcPkzjyqKvw tyObject_EmptySeq__uQOC49aSxZzQKcPkzjyqKvw; typedef struct tyObject_ChoiceWithEmptySeq_d__hy9agYq3kWtyifGrTP355nw tyObject_ChoiceWithEmptySeq_d__hy9agYq3kWtyifGrTP355nw; typedef NU8 tyEnum_ChoiceWithEmptySeq_selection__gM43DRIqTgBba2IBkbSf2Q; struct tyObject_EmptySeq__uQOC49aSxZzQKcPkzjyqKvw { char dummy; }; struct tyObject_ChoiceWithEmptySeq_d__hy9agYq3kWtyifGrTP355nw { NIM_BOOL a; }; union tyObject_INNER_C_UNION__nSy3jrICR0lkSmOVKZWCMw { NIM_CHAR a; tyObject_EmptySeq__uQOC49aSxZzQKcPkzjyqKvw b; NU8 c; tyObject_ChoiceWithEmptySeq_d__hy9agYq3kWtyifGrTP355nw d; }; struct tyObject_ChoiceWithEmptySeq__t7AEMm29aSJZlarP2nlNXPg { tyEnum_ChoiceWithEmptySeq_selection__gM43DRIqTgBba2IBkbSf2Q kind; tyObject_INNER_C_UNION__nSy3jrICR0lkSmOVKZWCMw u; }; struct tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew { NI state; NIM_BOOL init_done; tyObject_ChoiceWithEmptySeq__t7AEMm29aSJZlarP2nlNXPg ch; tyObject_EmptySeq__uQOC49aSxZzQKcPkzjyqKvw em; }; static N_INLINE(void, initStackBottomWith)(void* locals); N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); N_LIB_PRIVATE tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew context__eZjCef5qtZfly1K38Gq64Q = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} ; static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; systemDatInit000(); initStackBottomWith((void *)&inner); systemInit000(); (*inner)(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { } } ```

Stats

  • Started 2024-06-11T10:27:42
  • Finished 2024-06-11T10:27:42
  • Duration

AST

```nim nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("EmptySeq") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), newEmptyNode() ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq_d") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("a") ), newIdentNode("bool"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("INNER_C_UNION") ), nnkPragma.newTree( newIdentNode("bycopy"), newIdentNode("union") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("a") ), newIdentNode("char"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("b") ), newIdentNode("EmptySeq"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("c") ), newIdentNode("byte"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("d") ), newIdentNode("ChoiceWithEmptySeq_d"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq_selection") ), newEmptyNode(), nnkEnumTy.newTree( newEmptyNode(), newIdentNode("ChoiceWithEmptySeq_NONE"), newIdentNode("ChoiceWithEmptySeq_a_PRESENT"), newIdentNode("ChoiceWithEmptySeq_b_PRESENT"), newIdentNode("ChoiceWithEmptySeq_c_PRESENT"), newIdentNode("ChoiceWithEmptySeq_d_PRESENT") ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("kind") ), newIdentNode("ChoiceWithEmptySeq_selection"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("u") ), newIdentNode("INNER_C_UNION"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("Og_Context") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("state") ), newIdentNode("int"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("init_done") ), newIdentNode("bool"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ch") ), newIdentNode("ChoiceWithEmptySeq"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("em") ), newIdentNode("EmptySeq"), newEmptyNode() ) ) ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("context") ), newIdentNode("Og_Context"), nnkObjConstr.newTree( newIdentNode("Og_Context"), nnkExprColonExpr.newTree( newIdentNode("init_done"), newIdentNode("false") ) ) ) ) ) ```
1.2.18 :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/@mtemp.nim.c:58:117: error: extra brace group at end of initializer 58 | N_LIB_PRIVATE tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew context__eZjCef5qtZfly1K38Gq64Q = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} | ^ /home/runner/work/Nim/Nim/@mtemp.nim.c:58:117: note: (near initialization for ‘context__eZjCef5qtZfly1K38Gq64Q.ch.u’) /home/runner/work/Nim/Nim/@mtemp.nim.c:58:124: error: extra brace group at end of initializer 58 | N_LIB_PRIVATE tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew context__eZjCef5qtZfly1K38Gq64Q = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} | ^ /home/runner/work/Nim/Nim/@mtemp.nim.c:58:124: note: (near initialization for ‘context__eZjCef5qtZfly1K38Gq64Q.ch.u’) Error: execution of an external compiler program 'gcc -c -w -I/home/runner/.choosenim/toolchains/nim-1.2.18/lib -I/home/runner/work/Nim/Nim -o /home/runner/work/Nim/Nim/@mtemp.nim.c.o /home/runner/work/Nim/Nim/@mtemp.nim.c' failed with exit code: 1 ```

IR

Compiled filesize 0 (0 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #define nimfr_(x, y) #define nimln_(x, y) typedef struct tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew; typedef struct tyObject_ChoiceWithEmptySeq__t7AEMm29aSJZlarP2nlNXPg tyObject_ChoiceWithEmptySeq__t7AEMm29aSJZlarP2nlNXPg; typedef union tyObject_INNER_C_UNION__nSy3jrICR0lkSmOVKZWCMw tyObject_INNER_C_UNION__nSy3jrICR0lkSmOVKZWCMw; typedef struct tyObject_EmptySeq__uQOC49aSxZzQKcPkzjyqKvw tyObject_EmptySeq__uQOC49aSxZzQKcPkzjyqKvw; typedef struct tyObject_ChoiceWithEmptySeq_d__hy9agYq3kWtyifGrTP355nw tyObject_ChoiceWithEmptySeq_d__hy9agYq3kWtyifGrTP355nw; typedef NU8 tyEnum_ChoiceWithEmptySeq_selection__gM43DRIqTgBba2IBkbSf2Q; struct tyObject_EmptySeq__uQOC49aSxZzQKcPkzjyqKvw { char dummy; }; struct tyObject_ChoiceWithEmptySeq_d__hy9agYq3kWtyifGrTP355nw { NIM_BOOL a; }; union tyObject_INNER_C_UNION__nSy3jrICR0lkSmOVKZWCMw { NIM_CHAR a; tyObject_EmptySeq__uQOC49aSxZzQKcPkzjyqKvw b; NU8 c; tyObject_ChoiceWithEmptySeq_d__hy9agYq3kWtyifGrTP355nw d; }; struct tyObject_ChoiceWithEmptySeq__t7AEMm29aSJZlarP2nlNXPg { tyEnum_ChoiceWithEmptySeq_selection__gM43DRIqTgBba2IBkbSf2Q kind; tyObject_INNER_C_UNION__nSy3jrICR0lkSmOVKZWCMw u; }; struct tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew { NI state; NIM_BOOL init_done; tyObject_ChoiceWithEmptySeq__t7AEMm29aSJZlarP2nlNXPg ch; tyObject_EmptySeq__uQOC49aSxZzQKcPkzjyqKvw em; }; static N_INLINE(void, initStackBottomWith)(void* locals); N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); N_LIB_PRIVATE tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew context__eZjCef5qtZfly1K38Gq64Q = {0, NIM_FALSE, {0, {0, {}, 0, {NIM_FALSE}}}, {}} ; static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; systemDatInit000(); initStackBottomWith((void *)&inner); systemInit000(); (*inner)(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { } } ```

Stats

  • Started 2024-06-11T10:27:45
  • Finished 2024-06-11T10:27:45
  • Duration

AST

```nim nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("EmptySeq") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), newEmptyNode() ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq_d") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("a") ), newIdentNode("bool"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("INNER_C_UNION") ), nnkPragma.newTree( newIdentNode("bycopy"), newIdentNode("union") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("a") ), newIdentNode("char"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("b") ), newIdentNode("EmptySeq"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("c") ), newIdentNode("byte"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("d") ), newIdentNode("ChoiceWithEmptySeq_d"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq_selection") ), newEmptyNode(), nnkEnumTy.newTree( newEmptyNode(), newIdentNode("ChoiceWithEmptySeq_NONE"), newIdentNode("ChoiceWithEmptySeq_a_PRESENT"), newIdentNode("ChoiceWithEmptySeq_b_PRESENT"), newIdentNode("ChoiceWithEmptySeq_c_PRESENT"), newIdentNode("ChoiceWithEmptySeq_d_PRESENT") ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ChoiceWithEmptySeq") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("kind") ), newIdentNode("ChoiceWithEmptySeq_selection"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("u") ), newIdentNode("INNER_C_UNION"), newEmptyNode() ) ) ) ), nnkTypeDef.newTree( nnkPragmaExpr.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("Og_Context") ), nnkPragma.newTree( newIdentNode("bycopy") ) ), newEmptyNode(), nnkObjectTy.newTree( newEmptyNode(), newEmptyNode(), nnkRecList.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("state") ), newIdentNode("int"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("init_done") ), newIdentNode("bool"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("ch") ), newIdentNode("ChoiceWithEmptySeq"), newEmptyNode() ), nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("em") ), newIdentNode("EmptySeq"), newEmptyNode() ) ) ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("context") ), newIdentNode("Og_Context"), nnkObjConstr.newTree( newIdentNode("Og_Context"), nnkExprColonExpr.newTree( newIdentNode("init_done"), newIdentNode("false") ) ) ) ) ) ```
1.0.10 :+1: OK

Output

``` ```

IR

Compiled filesize 86.45 Kb (88,520 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #include # define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); # define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); # define nimln_(n, file) \ FR_.line = n; FR_.filename = file; typedef struct tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew; typedef struct tyObject_ChoiceWithEmptySeq__t7AEMm29aSJZlarP2nlNXPg tyObject_ChoiceWithEmptySeq__t7AEMm29aSJZlarP2nlNXPg; typedef union tyObject_INNER_C_UNION__nSy3jrICR0lkSmOVKZWCMw tyObject_INNER_C_UNION__nSy3jrICR0lkSmOVKZWCMw; typedef struct tyObject_EmptySeq__uQOC49aSxZzQKcPkzjyqKvw tyObject_EmptySeq__uQOC49aSxZzQKcPkzjyqKvw; typedef struct tyObject_ChoiceWithEmptySeq_d__hy9agYq3kWtyifGrTP355nw tyObject_ChoiceWithEmptySeq_d__hy9agYq3kWtyifGrTP355nw; typedef NU8 tyEnum_ChoiceWithEmptySeq_selection__gM43DRIqTgBba2IBkbSf2Q; struct tyObject_EmptySeq__uQOC49aSxZzQKcPkzjyqKvw { char dummy; }; struct tyObject_ChoiceWithEmptySeq_d__hy9agYq3kWtyifGrTP355nw { NIM_BOOL a; }; union tyObject_INNER_C_UNION__nSy3jrICR0lkSmOVKZWCMw { NIM_CHAR a; tyObject_EmptySeq__uQOC49aSxZzQKcPkzjyqKvw b; NU8 c; tyObject_ChoiceWithEmptySeq_d__hy9agYq3kWtyifGrTP355nw d; }; struct tyObject_ChoiceWithEmptySeq__t7AEMm29aSJZlarP2nlNXPg { tyEnum_ChoiceWithEmptySeq_selection__gM43DRIqTgBba2IBkbSf2Q kind; tyObject_INNER_C_UNION__nSy3jrICR0lkSmOVKZWCMw u; }; struct tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew { NI state; NIM_BOOL init_done; tyObject_ChoiceWithEmptySeq__t7AEMm29aSJZlarP2nlNXPg ch; tyObject_EmptySeq__uQOC49aSxZzQKcPkzjyqKvw em; }; N_NOINLINE(void, chckNil)(void* p); static N_INLINE(void, nimZeroMem)(void* p, NI size); static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size); static N_INLINE(void, initStackBottomWith)(void* locals); N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew context__eZjCef5qtZfly1K38Gq64Q; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) { void* T1_; T1_ = (void*)0; T1_ = memset(a, v, ((size_t) (size))); } static N_INLINE(void, nimZeroMem)(void* p, NI size) { nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size); } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } static N_INLINE(void, nimFrame)(TFrame* s) { NI T1_; T1_ = (NI)0; { if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA4_; T1_ = ((NI) 0); } goto LA2_; LA4_: ; { T1_ = ((NI) ((NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1)))); } LA2_: ; (*s).calldepth = ((NI16) (T1_)); (*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s; { if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA9_; callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw(); } LA9_: ; } static N_INLINE(void, popFrame)(void) { framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev; } void PreMainInner(void) { } int cmdCount; char** cmdLine; char** gEnv; void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; systemDatInit000(); initStackBottomWith((void *)&inner); systemInit000(); (*inner)(); } N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); chckNil((void*)(&context__eZjCef5qtZfly1K38Gq64Q)); nimZeroMem((void*)(&context__eZjCef5qtZfly1K38Gq64Q), sizeof(tyObject_Og_Context__bxoIigb1FBm2Vw5v9ceQLew)); context__eZjCef5qtZfly1K38Gq64Q.init_done = NIM_FALSE; popFrame(); } } ```

Stats

  • Started 2024-06-11T10:27:47
  • Finished 2024-06-11T10:27:47
  • Duration
??? :arrow_right: :bug:

Diagnostics

The commit that introduced the bug can not be found, but the bug is in the commits: (Can not find the commit because Nim can not be re-built commit-by-commit to bisect).
Stats
  • GCC 11.4.0
  • Clang 14.0.0
  • NodeJS 20.3
  • Created 2024-06-11T10:26:59Z
  • Comments 2
  • Commands nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim

:robot: Bug found in 29 minutes bisecting 5949 commits at 199 commits per second