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

internal error: getTypeDescAux(tyAnything) with auto in proc type #22842

Open
ghost opened this issue Oct 19, 2023 · 3 comments
Open

internal error: getTypeDescAux(tyAnything) with auto in proc type #22842

ghost opened this issue Oct 19, 2023 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 19, 2023

Description

Example:

proc register(cb: proc (e: auto): void) = discard

register(proc (e: int) = echo e)

Nim Version

Nim Compiler Version 2.1.1 [Windows: amd64]

0d4b3ed

This also occurs with 2.0.0.

Current Output

Error: internal error: getTypeDescAux(tyAnything)
No stack traceback available

Expected Output

No response

Possible Solution

No response

Additional Information

No response

@ringabout
Copy link
Member

!nim c

proc register(cb: proc (e: auto): void) = discard

register(proc (e: int) = echo e)

@github-actions
Copy link
Contributor

🐧 Linux bisect by @ringabout (member)
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 --warnings: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: getTypeDescAux(tyAnything)
assertions.nim(34)       raiseAssert
Error: unhandled exception: errInternal [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-19T09:19:11
  • Finished 2023-10-19T09:19:11
  • Duration

AST

nnkStmtList.newTree(
  nnkProcDef.newTree(
    newIdentNode("register"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("cb"),
        nnkProcTy.newTree(
          nnkFormalParams.newTree(
            newIdentNode("void"),
            nnkIdentDefs.newTree(
              newIdentNode("e"),
              newIdentNode("auto"),
              newEmptyNode()
            )
          ),
          newEmptyNode()
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkDiscardStmt.newTree(
        newEmptyNode()
      )
    )
  ),
  nnkCall.newTree(
    newIdentNode("register"),
    nnkLambda.newTree(
      newEmptyNode(),
      newEmptyNode(),
      newEmptyNode(),
      nnkFormalParams.newTree(
        newEmptyNode(),
        nnkIdentDefs.newTree(
          newIdentNode("e"),
          newIdentNode("int"),
          newEmptyNode()
        )
      ),
      newEmptyNode(),
      newEmptyNode(),
      nnkStmtList.newTree(
        nnkCommand.newTree(
          newIdentNode("echo"),
          newIdentNode("e")
        )
      )
    )
  )
)
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 --warnings: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: getTypeDescAux(tyAnything)
assertions.nim(34)       raiseAssert
Error: unhandled exception: options.nim(664, 5) `false` errInternal [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-19T09:19:12
  • Finished 2023-10-19T09:19:12
  • Duration

AST

nnkStmtList.newTree(
  nnkProcDef.newTree(
    newIdentNode("register"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("cb"),
        nnkProcTy.newTree(
          nnkFormalParams.newTree(
            newIdentNode("void"),
            nnkIdentDefs.newTree(
              newIdentNode("e"),
              newIdentNode("auto"),
              newEmptyNode()
            )
          ),
          newEmptyNode()
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkDiscardStmt.newTree(
        newEmptyNode()
      )
    )
  ),
  nnkCall.newTree(
    newIdentNode("register"),
    nnkLambda.newTree(
      newEmptyNode(),
      newEmptyNode(),
      newEmptyNode(),
      nnkFormalParams.newTree(
        newEmptyNode(),
        nnkIdentDefs.newTree(
          newIdentNode("e"),
          newIdentNode("int"),
          newEmptyNode()
        )
      ),
      newEmptyNode(),
      newEmptyNode(),
      nnkStmtList.newTree(
        nnkCommand.newTree(
          newIdentNode("echo"),
          newIdentNode("e")
        )
      )
    )
  )
)
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 --warnings: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: getTypeDescAux(tyAnything)
assertions.nim(34)       raiseAssert
Error: unhandled exception: options.nim(664, 5) `false` errInternal [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-19T09:19:13
  • Finished 2023-10-19T09:19:13
  • Duration

AST

nnkStmtList.newTree(
  nnkProcDef.newTree(
    newIdentNode("register"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("cb"),
        nnkProcTy.newTree(
          nnkFormalParams.newTree(
            newIdentNode("void"),
            nnkIdentDefs.newTree(
              newIdentNode("e"),
              newIdentNode("auto"),
              newEmptyNode()
            )
          ),
          newEmptyNode()
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkDiscardStmt.newTree(
        newEmptyNode()
      )
    )
  ),
  nnkCall.newTree(
    newIdentNode("register"),
    nnkLambda.newTree(
      newEmptyNode(),
      newEmptyNode(),
      newEmptyNode(),
      nnkFormalParams.newTree(
        newEmptyNode(),
        nnkIdentDefs.newTree(
          newIdentNode("e"),
          newIdentNode("int"),
          newEmptyNode()
        )
      ),
      newEmptyNode(),
      newEmptyNode(),
      nnkStmtList.newTree(
        nnkCommand.newTree(
          newIdentNode("echo"),
          newIdentNode("e")
        )
      )
    )
  )
)
1.6.14 👎 FAIL

Output

Error: Command failed: nim c --run  -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings: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: getTypeDescAux(tyAnything)
fatal.nim(54)            sysFatal
Error: unhandled exception: options.nim(645, 14) `false` errInternal [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-19T09:19:17
  • Finished 2023-10-19T09:19:17
  • Duration

AST

nnkStmtList.newTree(
  nnkProcDef.newTree(
    newIdentNode("register"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("cb"),
        nnkProcTy.newTree(
          nnkFormalParams.newTree(
            newIdentNode("void"),
            nnkIdentDefs.newTree(
              newIdentNode("e"),
              newIdentNode("auto"),
              newEmptyNode()
            )
          ),
          newEmptyNode()
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkDiscardStmt.newTree(
        newEmptyNode()
      )
    )
  ),
  nnkCall.newTree(
    newIdentNode("register"),
    nnkLambda.newTree(
      newEmptyNode(),
      newEmptyNode(),
      newEmptyNode(),
      nnkFormalParams.newTree(
        newEmptyNode(),
        nnkIdentDefs.newTree(
          newIdentNode("e"),
          newIdentNode("int"),
          newEmptyNode()
        )
      ),
      newEmptyNode(),
      newEmptyNode(),
      nnkStmtList.newTree(
        nnkCommand.newTree(
          newIdentNode("echo"),
          newIdentNode("e")
        )
      )
    )
  )
)
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 --warnings: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: getTypeDescAux(tyAnything)
No stack traceback available
To create a stacktrace, rerun compilation with './koch temp c <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-19T09:19:20
  • Finished 2023-10-19T09:19:21
  • Duration

AST

nnkStmtList.newTree(
  nnkProcDef.newTree(
    newIdentNode("register"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("cb"),
        nnkProcTy.newTree(
          nnkFormalParams.newTree(
            newIdentNode("void"),
            nnkIdentDefs.newTree(
              newIdentNode("e"),
              newIdentNode("auto"),
              newEmptyNode()
            )
          ),
          newEmptyNode()
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkDiscardStmt.newTree(
        newEmptyNode()
      )
    )
  ),
  nnkCall.newTree(
    newIdentNode("register"),
    nnkLambda.newTree(
      newEmptyNode(),
      newEmptyNode(),
      newEmptyNode(),
      nnkFormalParams.newTree(
        newEmptyNode(),
        nnkIdentDefs.newTree(
          newIdentNode("e"),
          newIdentNode("int"),
          newEmptyNode()
        )
      ),
      newEmptyNode(),
      newEmptyNode(),
      nnkStmtList.newTree(
        nnkCommand.newTree(
          newIdentNode("echo"),
          newIdentNode("e")
        )
      )
    )
  )
)
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 --warnings: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: getTypeDescAux(tyAnything)
No stack traceback available
To create a stacktrace, rerun compilation with ./koch temp c <file>

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-19T09:19:24
  • Finished 2023-10-19T09:19:25
  • Duration

AST

nnkStmtList.newTree(
  nnkProcDef.newTree(
    newIdentNode("register"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("cb"),
        nnkProcTy.newTree(
          nnkFormalParams.newTree(
            newIdentNode("void"),
            nnkIdentDefs.newTree(
              newIdentNode("e"),
              newIdentNode("auto"),
              newEmptyNode()
            )
          ),
          newEmptyNode()
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkDiscardStmt.newTree(
        newEmptyNode()
      )
    )
  ),
  nnkCall.newTree(
    newIdentNode("register"),
    nnkLambda.newTree(
      newEmptyNode(),
      newEmptyNode(),
      newEmptyNode(),
      nnkFormalParams.newTree(
        newEmptyNode(),
        nnkIdentDefs.newTree(
          newIdentNode("e"),
          newIdentNode("int"),
          newEmptyNode()
        )
      ),
      newEmptyNode(),
      newEmptyNode(),
      nnkStmtList.newTree(
        nnkCommand.newTree(
          newIdentNode("echo"),
          newIdentNode("e")
        )
      )
    )
  )
)
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 --warnings: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: getTypeDescAux(tyAnything)
No stack traceback available
To create a stacktrace, rerun compilation with ./koch temp c <file>

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-19T09:19:27
  • Finished 2023-10-19T09:19:28
  • Duration

AST

nnkStmtList.newTree(
  nnkProcDef.newTree(
    newIdentNode("register"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("cb"),
        nnkProcTy.newTree(
          nnkFormalParams.newTree(
            newIdentNode("void"),
            nnkIdentDefs.newTree(
              newIdentNode("e"),
              newIdentNode("auto"),
              newEmptyNode()
            )
          ),
          newEmptyNode()
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkDiscardStmt.newTree(
        newEmptyNode()
      )
    )
  ),
  nnkCall.newTree(
    newIdentNode("register"),
    nnkLambda.newTree(
      newEmptyNode(),
      newEmptyNode(),
      newEmptyNode(),
      nnkFormalParams.newTree(
        newEmptyNode(),
        nnkIdentDefs.newTree(
          newIdentNode("e"),
          newIdentNode("int"),
          newEmptyNode()
        )
      ),
      newEmptyNode(),
      newEmptyNode(),
      nnkStmtList.newTree(
        nnkCommand.newTree(
          newIdentNode("echo"),
          newIdentNode("e")
        )
      )
    )
  )
)
Stats
  • GCC 11.4.0
  • Clang 14.0.0
  • NodeJS 18.2
  • Created 2023-10-19T09:18:31Z
  • Comments 1
  • Commands nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings: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 21 minutes bisecting 7 commits at 0 commits per second

@metagn
Copy link
Collaborator

metagn commented Sep 18, 2024

Related #22921

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

No branches or pull requests

2 participants