Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic concepts not compatible with openarray #23872

Open
lilkeet opened this issue Jul 21, 2024 · 2 comments
Open

Generic concepts not compatible with openarray #23872

lilkeet opened this issue Jul 21, 2024 · 2 comments
Labels

Comments

@lilkeet
Copy link

lilkeet commented Jul 21, 2024

Description

Mixing generic concepts with openarray leads to compiler crashes.
The compiler matches compatible concept container types with the equivalent openarry type but mishandles them.
Procs taking the concept type, when passed an openarray, generate bad code.
Procs taking an openarray, when passed a concept, crash the nim compiler.

Example

import std / sequtils

type
  OrderedContainer*[T] = concept x # basically openarray in concept form
    x.len is SomeInteger
    for index, item in x.pairs:
      index is Ordinal
      item is T
    type IndexType = typeOf(x.pairs.toSeq[0].key)
    x[IndexType] is T


let exampleData = @[1, 2, 3]

block conceptInsideOpenArray:
  proc conceptProc[T](arg: OrderedContainer[T]) =
    echo arg.len

  proc openarrayProc[T](arg: openarray[T]) =
    conceptProc(arg)

  conceptProc(exampleData) # compiles
  openarrayProc(exampleData) # code gen fails



block openArrayInsideConcept:
  proc openarrayProc2[T](arg: openarray[T]) =
    echo arg.len

  proc conceptProc2[T](arg: OrderedContainer[T]) =
    openarrayProc2(arg)

  openarrayProc2(exampleData) # compiles
  conceptProc2(exampleData) # nim compiler crash

Nim Version

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

git hash: 5935c3b
active boot switches: -d:release

Current Output

Error: internal error: openArrayLoc: OrderedContainer[int, OrderedContainer]
No stack traceback available
To create a stacktrace, rerun compilation with './koch temp r <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details

and 

/path/to/.cache/nim/example_d/@mexample.nim.c: In function ‘conceptProc__example_u288’:
/path/to/.cache/nim/example_d/@mexample.nim.c:129:121: error: ‘arg_p0Len_0’ undeclared (first use in this function)
  129 |         nimlf_(18, "/path/to/example.nim");     colontmpD_ = dollar___systemZdollars_u8(arg_p0Len_0);
      |                                                                                                                         ^~~~~~~~~~~
/path/to/.cache/nim/example_d/@mexample.nim.c:129:121: note: each undeclared identifier is reported only once for each function it appears in
Error: execution of an external compiler program 'gcc -c  -w -fmax-errors=3 -pthread   -I/path/to/.choosenim/toolchains/nim-2.0.8/lib -I/path/to/Documents/digraph/src/digraph -o /path/to/.cache/nim/example_d/@mexample.nim.c.o /path/to/.cache/nim/example_d/@mexample.nim.c' failed with exit code: 1

Expected Output

3
3

Possible Solution

No response

Additional Information

No response

@juancarlospaco
Copy link
Collaborator

!nim c

import std / sequtils

type
  OrderedContainer*[T] = concept x # basically openarray in concept form
    x.len is SomeInteger
    for index, item in x.pairs:
      index is Ordinal
      item is T
    type IndexType = typeOf(x.pairs.toSeq[0].key)
    x[IndexType] is T


let exampleData = @[1, 2, 3]

block conceptInsideOpenArray:
  proc conceptProc[T](arg: OrderedContainer[T]) =
    echo arg.len

  proc openarrayProc[T](arg: openarray[T]) =
    conceptProc(arg)

  conceptProc(exampleData) # compiles
  openarrayProc(exampleData) # code gen fails



block openArrayInsideConcept:
  proc openarrayProc2[T](arg: openarray[T]) =
    echo arg.len

  proc conceptProc2[T](arg: OrderedContainer[T]) =
    openarrayProc2(arg)

  openarrayProc2(exampleData) # compiles
  conceptProc2(exampleData) # nim compiler crash

Copy link
Contributor

🐧 Linux bisect by @juancarlospaco (collaborator)
devel 👎 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
Error: internal error: openArrayLoc: OrderedContainer[int, OrderedContainer]
assertions.nim(34)       raiseAssert
Error: unhandled exception: errInternal [AssertionDefect]

IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-07-21T22:35:48
  • Finished 2024-07-21T22:35:49
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("sequtils")
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("OrderedContainer")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkTypeClassTy.newTree(
        nnkArgList.newTree(
          newIdentNode("x")
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("len")
            ),
            newIdentNode("SomeInteger")
          ),
          nnkForStmt.newTree(
            newIdentNode("index"),
            newIdentNode("item"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("pairs")
            ),
            nnkStmtList.newTree(
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("index"),
                newIdentNode("Ordinal")
              ),
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("item"),
                newIdentNode("T")
              )
            )
          ),
          nnkTypeSection.newTree(
            nnkTypeDef.newTree(
              newIdentNode("IndexType"),
              newEmptyNode(),
              nnkCall.newTree(
                newIdentNode("typeOf"),
                nnkDotExpr.newTree(
                  nnkBracketExpr.newTree(
                    nnkDotExpr.newTree(
                      nnkDotExpr.newTree(
                        newIdentNode("x"),
                        newIdentNode("pairs")
                      ),
                      newIdentNode("toSeq")
                    ),
                    newLit(0)
                  ),
                  newIdentNode("key")
                )
              )
            )
          ),
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkBracketExpr.newTree(
              newIdentNode("x"),
              newIdentNode("IndexType")
            ),
            newIdentNode("T")
          )
        )
      )
    )
  ),
  nnkLetSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("exampleData"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit(1),
          newLit(2),
          newLit(3)
        )
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("conceptInsideOpenArray"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("conceptProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("openarrayProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("conceptProc"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc"),
        newIdentNode("exampleData")
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("openArrayInsideConcept"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("openarrayProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("conceptProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("openarrayProc2"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc2"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc2"),
        newIdentNode("exampleData")
      )
    )
  )
)
stable 👎 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
Error: internal error: openArrayLoc: OrderedContainer[int, OrderedContainer]
assertions.nim(34)       raiseAssert
Error: unhandled exception: options.nim(682, 5) `false` errInternal [AssertionDefect]

IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-07-21T22:35:52
  • Finished 2024-07-21T22:35:53
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("sequtils")
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("OrderedContainer")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkTypeClassTy.newTree(
        nnkArgList.newTree(
          newIdentNode("x")
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("len")
            ),
            newIdentNode("SomeInteger")
          ),
          nnkForStmt.newTree(
            newIdentNode("index"),
            newIdentNode("item"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("pairs")
            ),
            nnkStmtList.newTree(
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("index"),
                newIdentNode("Ordinal")
              ),
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("item"),
                newIdentNode("T")
              )
            )
          ),
          nnkTypeSection.newTree(
            nnkTypeDef.newTree(
              newIdentNode("IndexType"),
              newEmptyNode(),
              nnkCall.newTree(
                newIdentNode("typeOf"),
                nnkDotExpr.newTree(
                  nnkBracketExpr.newTree(
                    nnkDotExpr.newTree(
                      nnkDotExpr.newTree(
                        newIdentNode("x"),
                        newIdentNode("pairs")
                      ),
                      newIdentNode("toSeq")
                    ),
                    newLit(0)
                  ),
                  newIdentNode("key")
                )
              )
            )
          ),
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkBracketExpr.newTree(
              newIdentNode("x"),
              newIdentNode("IndexType")
            ),
            newIdentNode("T")
          )
        )
      )
    )
  ),
  nnkLetSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("exampleData"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit(1),
          newLit(2),
          newLit(3)
        )
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("conceptInsideOpenArray"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("conceptProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("openarrayProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("conceptProc"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc"),
        newIdentNode("exampleData")
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("openArrayInsideConcept"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("openarrayProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("conceptProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("openarrayProc2"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc2"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc2"),
        newIdentNode("exampleData")
      )
    )
  )
)
2.0.4 👎 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
Error: internal error: openArrayLoc: OrderedContainer[int, OrderedContainer]
assertions.nim(34)       raiseAssert
Error: unhandled exception: options.nim(681, 5) `false` errInternal [AssertionDefect]

IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-07-21T22:35:55
  • Finished 2024-07-21T22:35:56
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("sequtils")
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("OrderedContainer")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkTypeClassTy.newTree(
        nnkArgList.newTree(
          newIdentNode("x")
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("len")
            ),
            newIdentNode("SomeInteger")
          ),
          nnkForStmt.newTree(
            newIdentNode("index"),
            newIdentNode("item"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("pairs")
            ),
            nnkStmtList.newTree(
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("index"),
                newIdentNode("Ordinal")
              ),
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("item"),
                newIdentNode("T")
              )
            )
          ),
          nnkTypeSection.newTree(
            nnkTypeDef.newTree(
              newIdentNode("IndexType"),
              newEmptyNode(),
              nnkCall.newTree(
                newIdentNode("typeOf"),
                nnkDotExpr.newTree(
                  nnkBracketExpr.newTree(
                    nnkDotExpr.newTree(
                      nnkDotExpr.newTree(
                        newIdentNode("x"),
                        newIdentNode("pairs")
                      ),
                      newIdentNode("toSeq")
                    ),
                    newLit(0)
                  ),
                  newIdentNode("key")
                )
              )
            )
          ),
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkBracketExpr.newTree(
              newIdentNode("x"),
              newIdentNode("IndexType")
            ),
            newIdentNode("T")
          )
        )
      )
    )
  ),
  nnkLetSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("exampleData"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit(1),
          newLit(2),
          newLit(3)
        )
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("conceptInsideOpenArray"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("conceptProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("openarrayProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("conceptProc"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc"),
        newIdentNode("exampleData")
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("openArrayInsideConcept"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("openarrayProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("conceptProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("openarrayProc2"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc2"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc2"),
        newIdentNode("exampleData")
      )
    )
  )
)
2.0.0 👎 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
Error: internal error: openArrayLoc: OrderedContainer[int, OrderedContainer]
assertions.nim(34)       raiseAssert
Error: unhandled exception: options.nim(664, 5) `false` errInternal [AssertionDefect]

IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-07-21T22:35:59
  • Finished 2024-07-21T22:35:59
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("sequtils")
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("OrderedContainer")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkTypeClassTy.newTree(
        nnkArgList.newTree(
          newIdentNode("x")
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("len")
            ),
            newIdentNode("SomeInteger")
          ),
          nnkForStmt.newTree(
            newIdentNode("index"),
            newIdentNode("item"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("pairs")
            ),
            nnkStmtList.newTree(
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("index"),
                newIdentNode("Ordinal")
              ),
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("item"),
                newIdentNode("T")
              )
            )
          ),
          nnkTypeSection.newTree(
            nnkTypeDef.newTree(
              newIdentNode("IndexType"),
              newEmptyNode(),
              nnkCall.newTree(
                newIdentNode("typeOf"),
                nnkDotExpr.newTree(
                  nnkBracketExpr.newTree(
                    nnkDotExpr.newTree(
                      nnkDotExpr.newTree(
                        newIdentNode("x"),
                        newIdentNode("pairs")
                      ),
                      newIdentNode("toSeq")
                    ),
                    newLit(0)
                  ),
                  newIdentNode("key")
                )
              )
            )
          ),
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkBracketExpr.newTree(
              newIdentNode("x"),
              newIdentNode("IndexType")
            ),
            newIdentNode("T")
          )
        )
      )
    )
  ),
  nnkLetSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("exampleData"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit(1),
          newLit(2),
          newLit(3)
        )
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("conceptInsideOpenArray"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("conceptProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("openarrayProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("conceptProc"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc"),
        newIdentNode("exampleData")
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("openArrayInsideConcept"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("openarrayProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("conceptProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("openarrayProc2"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc2"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc2"),
        newIdentNode("exampleData")
      )
    )
  )
)
1.6.20 👎 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
Error: internal error: openArrayLoc: OrderedContainer[int, OrderedContainer]
fatal.nim(54)            sysFatal
Error: unhandled exception: options.nim(662, 14) `false` errInternal [AssertionDefect]

IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-07-21T22:36:02
  • Finished 2024-07-21T22:36:02
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("sequtils")
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("OrderedContainer")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkTypeClassTy.newTree(
        nnkArgList.newTree(
          newIdentNode("x")
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("len")
            ),
            newIdentNode("SomeInteger")
          ),
          nnkForStmt.newTree(
            newIdentNode("index"),
            newIdentNode("item"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("pairs")
            ),
            nnkStmtList.newTree(
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("index"),
                newIdentNode("Ordinal")
              ),
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("item"),
                newIdentNode("T")
              )
            )
          ),
          nnkTypeSection.newTree(
            nnkTypeDef.newTree(
              newIdentNode("IndexType"),
              newEmptyNode(),
              nnkCall.newTree(
                newIdentNode("typeOf"),
                nnkDotExpr.newTree(
                  nnkBracketExpr.newTree(
                    nnkDotExpr.newTree(
                      nnkDotExpr.newTree(
                        newIdentNode("x"),
                        newIdentNode("pairs")
                      ),
                      newIdentNode("toSeq")
                    ),
                    newLit(0)
                  ),
                  newIdentNode("key")
                )
              )
            )
          ),
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkBracketExpr.newTree(
              newIdentNode("x"),
              newIdentNode("IndexType")
            ),
            newIdentNode("T")
          )
        )
      )
    )
  ),
  nnkLetSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("exampleData"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit(1),
          newLit(2),
          newLit(3)
        )
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("conceptInsideOpenArray"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("conceptProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("openarrayProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("conceptProc"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc"),
        newIdentNode("exampleData")
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("openArrayInsideConcept"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("openarrayProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("conceptProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("openarrayProc2"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc2"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc2"),
        newIdentNode("exampleData")
      )
    )
  )
)
1.4.8 👎 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/temp.nim(16, 14) Error: type mismatch: got <seq[int]>
but expected one of: 
proc conceptProc[T](arg: OrderedContainer[T])
  first type mismatch at position: 1
  required type for arg: OrderedContainer[T]
  but expression 'exampleData' is of type: seq[int]
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: attempting to call undeclared routine: 'pairs'
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: attempting to call undeclared routine: 'pairs'
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: expression 'pairs' cannot be called
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: expression '' has no type (or is ambiguous)
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(793, 23) template/generic instantiation of `toSeq1` from here
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: illformed AST: 
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(793, 23) template/generic instantiation of `toSeq1` from here
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: illformed AST: 
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(795, 23) OrderedContainer: wrong number of arguments
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(795, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(756, 17) OrderedContainer: undeclared identifier: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(795, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(756, 17) OrderedContainer: undeclared identifier: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(795, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(764, 27) OrderedContainer: undeclared identifier: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(795, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(764, 27) OrderedContainer: undeclared identifier: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(795, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(764, 32) OrderedContainer: attempting to call undeclared routine: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(795, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(764, 32) OrderedContainer: attempting to call undeclared routine: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(795, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/sequtils.nim(764, 32) OrderedContainer: type mismatch
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: illformed AST: 
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: illformed AST: 

expression: conceptProc(exampleData)

IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-07-21T22:36:04
  • Finished 2024-07-21T22:36:05
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("sequtils")
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("OrderedContainer")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkTypeClassTy.newTree(
        nnkArglist.newTree(
          newIdentNode("x")
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("len")
            ),
            newIdentNode("SomeInteger")
          ),
          nnkForStmt.newTree(
            newIdentNode("index"),
            newIdentNode("item"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("pairs")
            ),
            nnkStmtList.newTree(
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("index"),
                newIdentNode("Ordinal")
              ),
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("item"),
                newIdentNode("T")
              )
            )
          ),
          nnkTypeSection.newTree(
            nnkTypeDef.newTree(
              newIdentNode("IndexType"),
              newEmptyNode(),
              nnkCall.newTree(
                newIdentNode("typeOf"),
                nnkDotExpr.newTree(
                  nnkBracketExpr.newTree(
                    nnkDotExpr.newTree(
                      nnkDotExpr.newTree(
                        newIdentNode("x"),
                        newIdentNode("pairs")
                      ),
                      newIdentNode("toSeq")
                    ),
                    newLit(0)
                  ),
                  newIdentNode("key")
                )
              )
            )
          ),
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkBracketExpr.newTree(
              newIdentNode("x"),
              newIdentNode("IndexType")
            ),
            newIdentNode("T")
          )
        )
      )
    )
  ),
  nnkLetSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("exampleData"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit(1),
          newLit(2),
          newLit(3)
        )
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("conceptInsideOpenArray"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("conceptProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("openarrayProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("conceptProc"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc"),
        newIdentNode("exampleData")
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("openArrayInsideConcept"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("openarrayProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("conceptProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("openarrayProc2"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc2"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc2"),
        newIdentNode("exampleData")
      )
    )
  )
)
1.2.18 👎 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/temp.nim(16, 14) Error: type mismatch: got <seq[int]>
but expected one of: 
proc conceptProc[T](arg: OrderedContainer[T])
  first type mismatch at position: 1
  required type for arg: OrderedContainer[T]
  but expression 'exampleData' is of type: seq[int]
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: attempting to call undeclared routine: 'pairs'
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: attempting to call undeclared routine: 'pairs'
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: expression 'pairs' cannot be called
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(764, 23) template/generic instantiation of `toSeq1` from here
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: illformed AST: 
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(764, 23) template/generic instantiation of `toSeq1` from here
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: illformed AST: 
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(766, 23) OrderedContainer: wrong number of arguments
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(766, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(727, 17) OrderedContainer: undeclared identifier: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(766, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(727, 17) OrderedContainer: undeclared identifier: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(766, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(735, 25) OrderedContainer: undeclared identifier: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(766, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(735, 25) OrderedContainer: undeclared identifier: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(766, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(735, 30) OrderedContainer: attempting to call undeclared routine: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(766, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(735, 30) OrderedContainer: attempting to call undeclared routine: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(766, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/sequtils.nim(735, 30) OrderedContainer: type mismatch
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: illformed AST: 
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: illformed AST: 

expression: conceptProc(exampleData)

IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-07-21T22:36:07
  • Finished 2024-07-21T22:36:07
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("sequtils")
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("OrderedContainer")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkTypeClassTy.newTree(
        nnkArglist.newTree(
          newIdentNode("x")
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("len")
            ),
            newIdentNode("SomeInteger")
          ),
          nnkForStmt.newTree(
            newIdentNode("index"),
            newIdentNode("item"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("pairs")
            ),
            nnkStmtList.newTree(
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("index"),
                newIdentNode("Ordinal")
              ),
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("item"),
                newIdentNode("T")
              )
            )
          ),
          nnkTypeSection.newTree(
            nnkTypeDef.newTree(
              newIdentNode("IndexType"),
              newEmptyNode(),
              nnkCall.newTree(
                newIdentNode("typeOf"),
                nnkDotExpr.newTree(
                  nnkBracketExpr.newTree(
                    nnkDotExpr.newTree(
                      nnkDotExpr.newTree(
                        newIdentNode("x"),
                        newIdentNode("pairs")
                      ),
                      newIdentNode("toSeq")
                    ),
                    newLit(0)
                  ),
                  newIdentNode("key")
                )
              )
            )
          ),
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkBracketExpr.newTree(
              newIdentNode("x"),
              newIdentNode("IndexType")
            ),
            newIdentNode("T")
          )
        )
      )
    )
  ),
  nnkLetSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("exampleData"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit(1),
          newLit(2),
          newLit(3)
        )
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("conceptInsideOpenArray"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("conceptProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("openarrayProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("conceptProc"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc"),
        newIdentNode("exampleData")
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("openArrayInsideConcept"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("openarrayProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("conceptProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("openarrayProc2"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc2"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc2"),
        newIdentNode("exampleData")
      )
    )
  )
)
1.0.10 👎 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/temp.nim(16, 14) Error: type mismatch: got <seq[int]>
but expected one of: 
proc conceptProc[T](arg: OrderedContainer[T])
  first type mismatch at position: 1
  required type for arg: OrderedContainer[T]
  but expression 'exampleData' is of type: seq[int]
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: attempting to call undeclared routine: 'pairs'
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: attempting to call undeclared routine: 'pairs'
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: expression 'pairs' cannot be called
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(668, 23) template/generic instantiation of `toSeq1` from here
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: illformed AST: 
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(668, 23) template/generic instantiation of `toSeq1` from here
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: illformed AST: 
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(670, 23) OrderedContainer: wrong number of arguments
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(670, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(631, 17) OrderedContainer: undeclared identifier: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(670, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(631, 17) OrderedContainer: undeclared identifier: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(670, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(639, 25) OrderedContainer: undeclared identifier: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(670, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(639, 25) OrderedContainer: undeclared identifier: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(670, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(639, 30) OrderedContainer: attempting to call undeclared routine: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(670, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(639, 30) OrderedContainer: attempting to call undeclared routine: 'iter2'
/home/runner/work/Nim/Nim/temp.nim(8, 36) template/generic instantiation of `toSeq` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(670, 23) template/generic instantiation of `toSeq2` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/sequtils.nim(639, 30) OrderedContainer: type mismatch
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: illformed AST: 
/home/runner/work/Nim/Nim/temp.nim(8, 30) OrderedContainer: illformed AST: 

expression: conceptProc(exampleData)

IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-07-21T22:36:09
  • Finished 2024-07-21T22:36:09
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("sequtils")
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("OrderedContainer")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkTypeClassTy.newTree(
        nnkArglist.newTree(
          newIdentNode("x")
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("len")
            ),
            newIdentNode("SomeInteger")
          ),
          nnkForStmt.newTree(
            newIdentNode("index"),
            newIdentNode("item"),
            nnkDotExpr.newTree(
              newIdentNode("x"),
              newIdentNode("pairs")
            ),
            nnkStmtList.newTree(
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("index"),
                newIdentNode("Ordinal")
              ),
              nnkInfix.newTree(
                newIdentNode("is"),
                newIdentNode("item"),
                newIdentNode("T")
              )
            )
          ),
          nnkTypeSection.newTree(
            nnkTypeDef.newTree(
              newIdentNode("IndexType"),
              newEmptyNode(),
              nnkCall.newTree(
                newIdentNode("typeOf"),
                nnkDotExpr.newTree(
                  nnkBracketExpr.newTree(
                    nnkDotExpr.newTree(
                      nnkDotExpr.newTree(
                        newIdentNode("x"),
                        newIdentNode("pairs")
                      ),
                      newIdentNode("toSeq")
                    ),
                    newLit(0)
                  ),
                  newIdentNode("key")
                )
              )
            )
          ),
          nnkInfix.newTree(
            newIdentNode("is"),
            nnkBracketExpr.newTree(
              newIdentNode("x"),
              newIdentNode("IndexType")
            ),
            newIdentNode("T")
          )
        )
      )
    )
  ),
  nnkLetSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("exampleData"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit(1),
          newLit(2),
          newLit(3)
        )
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("conceptInsideOpenArray"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("conceptProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("openarrayProc"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("conceptProc"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc"),
        newIdentNode("exampleData")
      )
    )
  ),
  nnkBlockStmt.newTree(
    newIdentNode("openArrayInsideConcept"),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("openarrayProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("openarray"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCommand.newTree(
            newIdentNode("echo"),
            nnkDotExpr.newTree(
              newIdentNode("arg"),
              newIdentNode("len")
            )
          )
        )
      ),
      nnkProcDef.newTree(
        newIdentNode("conceptProc2"),
        newEmptyNode(),
        nnkGenericParams.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("T"),
            newEmptyNode(),
            newEmptyNode()
          )
        ),
        nnkFormalParams.newTree(
          newEmptyNode(),
          nnkIdentDefs.newTree(
            newIdentNode("arg"),
            nnkBracketExpr.newTree(
              newIdentNode("OrderedContainer"),
              newIdentNode("T")
            ),
            newEmptyNode()
          )
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkCall.newTree(
            newIdentNode("openarrayProc2"),
            newIdentNode("arg")
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("openarrayProc2"),
        newIdentNode("exampleData")
      ),
      nnkCall.newTree(
        newIdentNode("conceptProc2"),
        newIdentNode("exampleData")
      )
    )
  )
)
Stats
  • GCC 11.4.0
  • Clang 14.0.0
  • NodeJS 20.4
  • Created 2024-07-21T22:35:22Z
  • Comments 1
  • 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

🤖 Bug found in 23 minutes bisecting 8 commits at 0 commits per second

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants