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

Invalid type checking for two instances of the same Generic type #22826

Closed
can-lehmann opened this issue Oct 15, 2023 · 4 comments · Fixed by #22828
Closed

Invalid type checking for two instances of the same Generic type #22826

can-lehmann opened this issue Oct 15, 2023 · 4 comments · Fixed by #22828

Comments

@can-lehmann
Copy link
Contributor

can-lehmann commented Oct 15, 2023

Description

When instancing the Table type with the same key type and value types T and SomeGenericThatUsesTable[T], typechecking fails.

Minimal example

import std/tables

var a: Table[string, float]

type Value*[T] = object
  table: Table[string, Value[T]]

discard toTable({"a": Value[float]()})

Nim Version

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

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

Current Output

PATH/main.nim(8, 16) template/generic instantiation of `toTable` from here
NIM_PATH/lib/pure/collections/tables.nim(313, 45) template/generic instantiation of `[]=` from here
NIM_PATH/lib/pure/collections/tableimpl.nim(61, 38) Error: type mismatch: got 'sink Value[system.float]' for 'val' but expected 'float'

Expected Output

Compiles correctly

Possible Solution

No response

Additional Information

It seems to be present at least in devel, 2.0.0, 1.6.8 and 1.6.0.

@ringabout
Copy link
Member

!nim c

import std/tables

var a: Table[string, float]

type Value*[T] = object
  table: Table[string, Value[T]]

discard toTable({"a": Value[float]()})

@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
/home/runner/work/Nim/Nim/temp.nim(5, 16) template/generic instantiation of `toTable` from here
/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/tables.nim(313, 45) template/generic instantiation of `[]=` from here
/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/tableimpl.nim(61, 38) Error: type mismatch: got 'sink Value[system.float]' for 'val' but expected 'float'
assertions.nim(34)       raiseAssert
Error: unhandled exception: errGenerated [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T04:50:46
  • Finished 2023-10-16T04:50:46
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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
/home/runner/work/Nim/Nim/temp.nim(5, 16) template/generic instantiation of `toTable` from here
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/pure/collections/tables.nim(316, 45) template/generic instantiation of `[]=` from here
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/pure/collections/tableimpl.nim(61, 38) Error: type mismatch: got 'sink Value[system.float]' for 'val' but expected 'float'
assertions.nim(34)       raiseAssert
Error: unhandled exception: options.nim(664, 5) `false` errGenerated [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T04:50:47
  • Finished 2023-10-16T04:50:47
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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
/home/runner/work/Nim/Nim/temp.nim(5, 16) template/generic instantiation of `toTable` from here
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/pure/collections/tables.nim(316, 45) template/generic instantiation of `[]=` from here
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/pure/collections/tableimpl.nim(61, 38) Error: type mismatch: got 'sink Value[system.float]' for 'val' but expected 'float'
assertions.nim(34)       raiseAssert
Error: unhandled exception: options.nim(664, 5) `false` errGenerated [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T04:50:48
  • Finished 2023-10-16T04:50:48
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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
/home/runner/work/Nim/Nim/temp.nim(5, 16) template/generic instantiation of `toTable` from here
/home/runner/.choosenim/toolchains/nim-1.6.14/lib/pure/collections/tables.nim(315, 45) template/generic instantiation of `[]=` from here
/home/runner/.choosenim/toolchains/nim-1.6.14/lib/pure/collections/tableimpl.nim(59, 38) Error: type mismatch: got 'sink Value[system.float]' for 'val' but expected 'float'
fatal.nim(54)            sysFatal
Error: unhandled exception: options.nim(645, 14) `false` errGenerated [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T04:50:52
  • Finished 2023-10-16T04:50:52
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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
/home/runner/work/Nim/Nim/temp.nim(5, 16) template/generic instantiation of `toTable` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/tables.nim(333, 45) template/generic instantiation of `[]=` from here
/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/tableimpl.nim(59, 38) Error: type mismatch: got <sink Value[system.float]> but expected 'float'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T04:50:55
  • Finished 2023-10-16T04:50:55
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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
/home/runner/work/Nim/Nim/temp.nim(5, 16) template/generic instantiation of `toTable` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/tables.nim(339, 45) template/generic instantiation of `[]=` from here
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/tableimpl.nim(59, 38) Error: type mismatch: got <Value[system.float]> but expected 'float'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T04:50:58
  • Finished 2023-10-16T04:50:58
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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
/home/runner/work/Nim/Nim/temp.nim(5, 16) template/generic instantiation of `toTable` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/tables.nim(341, 45) template/generic instantiation of `[]=` from here
/home/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/tableimpl.nim(59, 38) Error: type mismatch: got <Value[system.float]> but expected 'float'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T04:51:00
  • Finished 2023-10-16T04:51:00
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
Stats
  • GCC 11.4.0
  • Clang 14.0.0
  • NodeJS 18.0
  • Created 2023-10-16T04:50:12Z
  • 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 18 minutes bisecting 7 commits at 0 commits per second

@github-actions
Copy link
Contributor

🪟 Windows 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:D:\a\Nim\Nim --out:D:\a\Nim\Nim/temp D:\a\Nim\Nim/temp.nim
D:\a\Nim\Nim\temp.nim(5, 16) template/generic instantiation of `toTable` from here
C:\Users\runneradmin\.choosenim\toolchains\nim-#devel\lib\pure\collections\tables.nim(313, 45) template/generic instantiation of `[]=` from here
C:\Users\runneradmin\.choosenim\toolchains\nim-#devel\lib\pure\collections\tableimpl.nim(61, 38) Error: type mismatch: got 'sink Value[system.float]' for 'val' but expected 'float'
assertions.nim(34)       raiseAssert
Error: unhandled exception: errGenerated [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T04:52:21
  • Finished 2023-10-16T04:52:22
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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:D:\a\Nim\Nim --out:D:\a\Nim\Nim/temp D:\a\Nim\Nim/temp.nim
D:\a\Nim\Nim\temp.nim(5, 16) template/generic instantiation of `toTable` from here
C:\Users\runneradmin\.choosenim\toolchains\nim-2.0.0\lib\pure\collections\tables.nim(316, 45) template/generic instantiation of `[]=` from here
C:\Users\runneradmin\.choosenim\toolchains\nim-2.0.0\lib\pure\collections\tableimpl.nim(61, 38) Error: type mismatch: got 'sink Value[system.float]' for 'val' but expected 'float'
assertions.nim(34)       raiseAssert
Error: unhandled exception: options.nim(664, 5) `false` errGenerated [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T04:52:47
  • Finished 2023-10-16T04:52:48
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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:D:\a\Nim\Nim --out:D:\a\Nim\Nim/temp D:\a\Nim\Nim/temp.nim
D:\a\Nim\Nim\temp.nim(5, 16) template/generic instantiation of `toTable` from here
C:\Users\runneradmin\.choosenim\toolchains\nim-2.0.0\lib\pure\collections\tables.nim(316, 45) template/generic instantiation of `[]=` from here
C:\Users\runneradmin\.choosenim\toolchains\nim-2.0.0\lib\pure\collections\tableimpl.nim(61, 38) Error: type mismatch: got 'sink Value[system.float]' for 'val' but expected 'float'
assertions.nim(34)       raiseAssert
Error: unhandled exception: options.nim(664, 5) `false` errGenerated [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T04:52:48
  • Finished 2023-10-16T04:52:49
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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:D:\a\Nim\Nim --out:D:\a\Nim\Nim/temp D:\a\Nim\Nim/temp.nim
D:\a\Nim\Nim\temp.nim(5, 16) template/generic instantiation of `toTable` from here
C:\Users\runneradmin\.choosenim\toolchains\nim-1.6.14\lib\pure\collections\tables.nim(315, 45) template/generic instantiation of `[]=` from here
C:\Users\runneradmin\.choosenim\toolchains\nim-1.6.14\lib\pure\collections\tableimpl.nim(59, 38) Error: type mismatch: got 'sink Value[system.float]' for 'val' but expected 'float'
fatal.nim(54)            sysFatal
Error: unhandled exception: options.nim(645, 14) `false` errGenerated [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T04:53:12
  • Finished 2023-10-16T04:53:13
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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:D:\a\Nim\Nim --out:D:\a\Nim\Nim/temp D:\a\Nim\Nim/temp.nim
D:\a\Nim\Nim\temp.nim(5, 16) template/generic instantiation of `toTable` from here
C:\Users\runneradmin\.choosenim\toolchains\nim-1.4.8\lib\pure\collections\tables.nim(333, 45) template/generic instantiation of `[]=` from here
C:\Users\runneradmin\.choosenim\toolchains\nim-1.4.8\lib\pure\collections\tableimpl.nim(59, 38) Error: type mismatch: got <sink Value[system.float]> but expected 'float'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T04:53:31
  • Finished 2023-10-16T04:53:31
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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:D:\a\Nim\Nim --out:D:\a\Nim\Nim/temp D:\a\Nim\Nim/temp.nim
D:\a\Nim\Nim\temp.nim(5, 16) template/generic instantiation of `toTable` from here
C:\Users\runneradmin\.choosenim\toolchains\nim-1.2.18\lib\pure\collections\tables.nim(339, 45) template/generic instantiation of `[]=` from here
C:\Users\runneradmin\.choosenim\toolchains\nim-1.2.18\lib\pure\collections\tableimpl.nim(59, 38) Error: type mismatch: got <Value[system.float]> but expected 'float'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T04:53:48
  • Finished 2023-10-16T04:53:49
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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:D:\a\Nim\Nim --out:D:\a\Nim\Nim/temp D:\a\Nim\Nim/temp.nim
D:\a\Nim\Nim\temp.nim(5, 16) template/generic instantiation of `toTable` from here
C:\Users\runneradmin\.choosenim\toolchains\nim-1.0.10\lib\pure\collections\tables.nim(341, 45) template/generic instantiation of `[]=` from here
C:\Users\runneradmin\.choosenim\toolchains\nim-1.0.10\lib\pure\collections\tableimpl.nim(59, 38) Error: type mismatch: got <Value[system.float]> but expected 'float'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T04:54:06
  • Finished 2023-10-16T04:54:06
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
Stats
  • GCC 12.2.0
  • Clang 16.0.6
  • NodeJS 18.0
  • Created 2023-10-16T04:50:12Z
  • 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:D:\a\Nim\Nim --out:D:\a\Nim\Nim/temp D:\a\Nim\Nim/temp.nim

🤖 Bug found in 1 minutes bisecting 7 commits at 4 commits per second

@github-actions
Copy link
Contributor

🍎 macOS 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:/Users/runner/work/Nim/Nim --out:/Users/runner/work/Nim/Nim/temp /Users/runner/work/Nim/Nim/temp.nim
/Users/runner/work/Nim/Nim/temp.nim(5, 16) template/generic instantiation of `toTable` from here
/Users/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/tables.nim(313, 45) template/generic instantiation of `[]=` from here
/Users/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/tableimpl.nim(61, 38) Error: type mismatch: got 'sink Value[system.float]' for 'val' but expected 'float'
assertions.nim(34)       raiseAssert
Error: unhandled exception: errGenerated [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T05:01:18
  • Finished 2023-10-16T05:01:19
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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:/Users/runner/work/Nim/Nim --out:/Users/runner/work/Nim/Nim/temp /Users/runner/work/Nim/Nim/temp.nim
/Users/runner/work/Nim/Nim/temp.nim(5, 16) template/generic instantiation of `toTable` from here
/Users/runner/.choosenim/toolchains/nim-2.0.0/lib/pure/collections/tables.nim(316, 45) template/generic instantiation of `[]=` from here
/Users/runner/.choosenim/toolchains/nim-2.0.0/lib/pure/collections/tableimpl.nim(61, 38) Error: type mismatch: got 'sink Value[system.float]' for 'val' but expected 'float'
assertions.nim(34)       raiseAssert
Error: unhandled exception: options.nim(664, 5) `false` errGenerated [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T05:01:20
  • Finished 2023-10-16T05:01:21
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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:/Users/runner/work/Nim/Nim --out:/Users/runner/work/Nim/Nim/temp /Users/runner/work/Nim/Nim/temp.nim
/Users/runner/work/Nim/Nim/temp.nim(5, 16) template/generic instantiation of `toTable` from here
/Users/runner/.choosenim/toolchains/nim-2.0.0/lib/pure/collections/tables.nim(316, 45) template/generic instantiation of `[]=` from here
/Users/runner/.choosenim/toolchains/nim-2.0.0/lib/pure/collections/tableimpl.nim(61, 38) Error: type mismatch: got 'sink Value[system.float]' for 'val' but expected 'float'
assertions.nim(34)       raiseAssert
Error: unhandled exception: options.nim(664, 5) `false` errGenerated [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T05:01:21
  • Finished 2023-10-16T05:01:22
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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:/Users/runner/work/Nim/Nim --out:/Users/runner/work/Nim/Nim/temp /Users/runner/work/Nim/Nim/temp.nim
/Users/runner/work/Nim/Nim/temp.nim(5, 16) template/generic instantiation of `toTable` from here
/Users/runner/.choosenim/toolchains/nim-1.6.14/lib/pure/collections/tables.nim(315, 45) template/generic instantiation of `[]=` from here
/Users/runner/.choosenim/toolchains/nim-1.6.14/lib/pure/collections/tableimpl.nim(59, 38) Error: type mismatch: got 'sink Value[system.float]' for 'val' but expected 'float'
fatal.nim(54)            sysFatal
Error: unhandled exception: options.nim(645, 14) `false` errGenerated [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T05:08:20
  • Finished 2023-10-16T05:08:21
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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:/Users/runner/work/Nim/Nim --out:/Users/runner/work/Nim/Nim/temp /Users/runner/work/Nim/Nim/temp.nim
/Users/runner/work/Nim/Nim/temp.nim(5, 16) template/generic instantiation of `toTable` from here
/Users/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/tables.nim(333, 45) template/generic instantiation of `[]=` from here
/Users/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/tableimpl.nim(59, 38) Error: type mismatch: got <sink Value[system.float]> but expected 'float'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T05:12:18
  • Finished 2023-10-16T05:12:18
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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:/Users/runner/work/Nim/Nim --out:/Users/runner/work/Nim/Nim/temp /Users/runner/work/Nim/Nim/temp.nim
/Users/runner/work/Nim/Nim/temp.nim(5, 16) template/generic instantiation of `toTable` from here
/Users/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/tables.nim(339, 45) template/generic instantiation of `[]=` from here
/Users/runner/.choosenim/toolchains/nim-1.2.18/lib/pure/collections/tableimpl.nim(59, 38) Error: type mismatch: got <Value[system.float]> but expected 'float'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T05:15:56
  • Finished 2023-10-16T05:15:56
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
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:/Users/runner/work/Nim/Nim --out:/Users/runner/work/Nim/Nim/temp /Users/runner/work/Nim/Nim/temp.nim
/Users/runner/work/Nim/Nim/temp.nim(5, 16) template/generic instantiation of `toTable` from here
/Users/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/tables.nim(341, 45) template/generic instantiation of `[]=` from here
/Users/runner/.choosenim/toolchains/nim-1.0.10/lib/pure/collections/tableimpl.nim(59, 38) Error: type mismatch: got <Value[system.float]> but expected 'float'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-16T05:19:44
  • Finished 2023-10-16T05:19:44
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkVarSection.newTree(
    nnkIdentDefs.newTree(
      newIdentNode("a"),
      nnkBracketExpr.newTree(
        newIdentNode("Table"),
        newIdentNode("string"),
        newIdentNode("float")
      ),
      newEmptyNode()
    )
  ),
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      nnkPostfix.newTree(
        newIdentNode("*"),
        newIdentNode("Value")
      ),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        nnkRecList.newTree(
          nnkIdentDefs.newTree(
            newIdentNode("table"),
            nnkBracketExpr.newTree(
              newIdentNode("Table"),
              newIdentNode("string"),
              nnkBracketExpr.newTree(
                newIdentNode("Value"),
                newIdentNode("T")
              )
            ),
            newEmptyNode()
          )
        )
      )
    )
  ),
  nnkDiscardStmt.newTree(
    nnkCall.newTree(
      newIdentNode("toTable"),
      nnkTableConstr.newTree(
        nnkExprColonExpr.newTree(
          newLit("a"),
          nnkCall.newTree(
            nnkBracketExpr.newTree(
              newIdentNode("Value"),
              newIdentNode("float")
            )
          )
        )
      )
    )
  )
)
Stats
  • GCC 14.0.0
  • Clang 14.0.0
  • NodeJS 18.0
  • Created 2023-10-16T04:50:12Z
  • 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:/Users/runner/work/Nim/Nim --out:/Users/runner/work/Nim/Nim/temp /Users/runner/work/Nim/Nim/temp.nim

🤖 Bug found in 34 minutes bisecting 7 commits at 0 commits per second

Araq pushed a commit that referenced this issue Oct 21, 2023
Close #22826

I am not sure why this code skips generic insts, so letting CI tell me.
Update: It has told me nothing. Maybe someone knows during review.

Issue itself seems to be that the generic instance is skipped thus it
ends up being just `float` which makes it use the wrong generic instance
of the proc because it matches the one in cache

---------

Co-authored-by: SirOlaf <>
narimiran pushed a commit that referenced this issue Apr 18, 2024
Close #22826

I am not sure why this code skips generic insts, so letting CI tell me.
Update: It has told me nothing. Maybe someone knows during review.

Issue itself seems to be that the generic instance is skipped thus it
ends up being just `float` which makes it use the wrong generic instance
of the proc because it matches the one in cache

---------

Co-authored-by: SirOlaf <>
(cherry picked from commit c13c485)
narimiran pushed a commit that referenced this issue Sep 16, 2024
Close #22826

I am not sure why this code skips generic insts, so letting CI tell me.
Update: It has told me nothing. Maybe someone knows during review.

Issue itself seems to be that the generic instance is skipped thus it
ends up being just `float` which makes it use the wrong generic instance
of the proc because it matches the one in cache

---------

Co-authored-by: SirOlaf <>
(cherry picked from commit c13c485)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants