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

Static seq default arguments cause incorrect type mismatch #22793

Open
PhilippMDoerner opened this issue Oct 5, 2023 · 7 comments
Open

Static seq default arguments cause incorrect type mismatch #22793

PhilippMDoerner opened this issue Oct 5, 2023 · 7 comments

Comments

@PhilippMDoerner
Copy link
Contributor

PhilippMDoerner commented Oct 5, 2023

Description

With procs you have the feature that you can assign default values to their parameters.
proc someProc(x: int = 5) is a valid proc, which uses 5 as a parameter value if the parameter x is not set by the caller of someProc.

For sequences you can pass even pass empty sequences as default values!
This does not break, because the compiler will infer the type of the empty seq based on the type of the parameter itself.
This inference breaks when the parameter type is a static seq.

See below an example:

const x = @["a", "b"]

proc myProc(x: seq[string]) =
  echo x
x.myProc()

proc myProc2(x: seq[string] = @[]) = # Compiler correctly infers that `@[]` is `seq[string]`
  echo x
x.myProc2()
  
proc myProc3(x: static seq[string]) =
  echo x
x.myProc3()

proc myProc4(x: static seq[string] = @[]) = # This proc causes a compiler error. Compiler does not infer that `@[]` is `static seq[string]`
  echo x
x.myProc4()

Nim Version

Nim Compiler Version 2.0.0 [Linux: amd64]
Compiled at 2023-08-01
Copyright (c) 2006-2023 by Andreas Rumpf

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

Current Output

Error: type mismatch: got 'seq[empty]' for '[]' but expected 'static[seq[string]]'

Expected Output

@["a", "b"]
@["a", "b"]
@["a", "b"]
@["a", "b"]

Possible Solution

No response

Additional Information

static seq[T] is the only other type I could create this kind of problem for.
For other more generic types like Option it works fine.

@juancarlospaco
Copy link
Collaborator

!nim c

const x = @["a", "b"]

proc myProc(x: seq[string]) = echo x
x.myProc()

proc myProc2(x: seq[string] = @[]) = echo x
x.myProc2()

proc myProc3(x: static seq[string]) = echo x
x.myProc3()

proc myProc4(x: static seq[string] = @[]) = echo x
x.myProc4()

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

🐧 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 --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(8, 39) Error: type mismatch: got 'seq[empty]' for '[]' but expected 'static[seq[string]]'
assertions.nim(34)       raiseAssert
Error: unhandled exception: errGenerated [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-05T10:59:02
  • Finished 2023-10-05T10:59:03
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got 'seq[empty]' for '[]' but expected 'static[seq[string]]'
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-05T10:59:03
  • Finished 2023-10-05T10:59:04
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got 'seq[empty]' for '[]' but expected 'static[seq[string]]'
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-05T10:59:04
  • Finished 2023-10-05T10:59:04
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got 'seq[empty]' for '[]' but expected 'static[seq[string]]'
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-05T10:59:07
  • Finished 2023-10-05T10:59:07
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got <seq[empty]> but expected 'static[seq[string]]'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-05T10:59:10
  • Finished 2023-10-05T10:59:10
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got <static[array[0..-1, empty]]([])> but expected 'static[seq[string]]'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-05T10:59:13
  • Finished 2023-10-05T10:59:13
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got <static[array[0..-1, empty]]([])> but expected 'static[seq[string]]'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-05T10:59:15
  • Finished 2023-10-05T10:59:15
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
Stats
  • GCC 11.4.0
  • Clang 14.0.0
  • NodeJS 18.0
  • Created 2023-10-05T10:58: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 16 minutes bisecting 7 commits at 0 commits per second

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

🪟 Windows 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 --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(8, 39) Error: type mismatch: got 'seq[empty]' for '[]' but expected 'static[seq[string]]'
assertions.nim(34)       raiseAssert
Error: unhandled exception: errGenerated [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-05T11:00:56
  • Finished 2023-10-05T11:00:57
  • Duration 1 minutes

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got 'seq[empty]' for '[]' but expected 'static[seq[string]]'
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-05T11:01:22
  • Finished 2023-10-05T11:01:22
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got 'seq[empty]' for '[]' but expected 'static[seq[string]]'
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-05T11:01:23
  • Finished 2023-10-05T11:01:24
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got 'seq[empty]' for '[]' but expected 'static[seq[string]]'
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-05T11:01:47
  • Finished 2023-10-05T11:01:48
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got <seq[empty]> but expected 'static[seq[string]]'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-05T11:02:08
  • Finished 2023-10-05T11:02:08
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got <static[array[0..-1, empty]]([])> but expected 'static[seq[string]]'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-05T11:02:30
  • Finished 2023-10-05T11:02:31
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got <static[array[0..-1, empty]]([])> but expected 'static[seq[string]]'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-05T11:02:49
  • Finished 2023-10-05T11:02:49
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
Stats
  • GCC 12.2.0
  • Clang 16.0.6
  • NodeJS 18.0
  • Created 2023-10-05T10:58: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:D:\a\Nim\Nim --out:D:\a\Nim\Nim/temp D:\a\Nim\Nim/temp.nim

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

🍎 macOS 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 --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(8, 39) Error: type mismatch: got 'seq[empty]' for '[]' but expected 'static[seq[string]]'
assertions.nim(34)       raiseAssert
Error: unhandled exception: errGenerated [AssertionDefect]

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-05T11:10:31
  • Finished 2023-10-05T11:10:32
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got 'seq[empty]' for '[]' but expected 'static[seq[string]]'
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-05T11:10:33
  • Finished 2023-10-05T11:10:33
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got 'seq[empty]' for '[]' but expected 'static[seq[string]]'
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-05T11:10:33
  • Finished 2023-10-05T11:10:34
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got 'seq[empty]' for '[]' but expected 'static[seq[string]]'
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-05T11:16:18
  • Finished 2023-10-05T11:16:19
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got <seq[empty]> but expected 'static[seq[string]]'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-05T11:20:20
  • Finished 2023-10-05T11:20:20
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got <static[array[0..-1, empty]]([])> but expected 'static[seq[string]]'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-05T11:24:02
  • Finished 2023-10-05T11:24:02
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
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(8, 39) Error: type mismatch: got <static[array[0..-1, empty]]([])> but expected 'static[seq[string]]'

IR

Compiled filesize 0 bytes (0 bytes)

Stats

  • Started 2023-10-05T11:27:45
  • Finished 2023-10-05T11:27:45
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("x"),
      newEmptyNode(),
      nnkPrefix.newTree(
        newIdentNode("@"),
        nnkBracket.newTree(
          newLit("a"),
          newLit("b")
        )
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc2"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkBracketExpr.newTree(
          newIdentNode("seq"),
          newIdentNode("string")
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc2")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc3"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc3")
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("myProc4"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode(),
      nnkIdentDefs.newTree(
        newIdentNode("x"),
        nnkCommand.newTree(
          newIdentNode("static"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            newIdentNode("string")
          )
        ),
        nnkPrefix.newTree(
          newIdentNode("@"),
          nnkBracket.newTree(
          )
        )
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("x")
      )
    )
  ),
  nnkCall.newTree(
    nnkDotExpr.newTree(
      newIdentNode("x"),
      newIdentNode("myProc4")
    )
  )
)
Stats
  • GCC 14.0.0
  • Clang 14.0.0
  • NodeJS 18.0
  • Created 2023-10-05T10:58: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:/Users/runner/work/Nim/Nim --out:/Users/runner/work/Nim/Nim/temp /Users/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 Oct 5, 2023

Not related to empty sequence type inference? Also where is the compiler crash?

const x = @["a", "b"]

proc myProc4(x: static seq[string] = @["a"]) =
  echo x

x.myProc4()
(3, 39) Error: type mismatch: got 'seq[string]' for '["a"]' but expected 'static[seq[string]]'

@PhilippMDoerner
Copy link
Contributor Author

Not related to empty sequence type inference? Also where is the compiler crash?

const x = @["a", "b"]

proc myProc4(x: static seq[string] = @["a"]) =
  echo x

x.myProc4()
(3, 39) Error: type mismatch: got 'seq[string]' for '["a"]' but expected 'static[seq[string]]'

I'm happy to rename based on suggestions.
With the compiler telling me "It's not X, it is Y" as an end-user of the compiler I can only assume that it is the type-inference of the compiler that is borked here, as it is incorrectly identifying the type of the default value.

@metagn metagn changed the title Type inference for proc parameter default values with static seq types does not work Static seq default arguments cause incorrect type mismatch Oct 13, 2023
@metagn
Copy link
Collaborator

metagn commented Sep 5, 2024

Sorry for misleading, there seems to be 2 issues here:

  1. Same issue as Codegen bug with proc with union arguments with default values #13944 and Referring to a static nil objects's field is impossible, even when it should #12559, @[] matches static seq[string] but has type seq[empty] which doesn't get updated:
proc myProc3(x: static seq[string]) =
  echo x
myProc3(@[]) # type mismatch with echo
  1. The default parameter value @["a"] doesn't get converted to static seq[string] the same way a normal parameter does

Same issue #9863

metagn added a commit to metagn/Nim that referenced this issue Sep 28, 2024
Araq pushed a commit that referenced this issue Oct 3, 2024
fixes #23010, split from #24195

When resemming bracket nodes, the compiler currently unconditionally
makes a new node with an array type based on the node. However the VM
can generate bracket nodes with `seq` types, which this erases. To fix
this, if a bracket node already has a type, we still resem the bracket
node, but don't construct a new type for it, instead using the type of
the original node.

A version of this was rejected that didn't resem the node at all if it
was typed, but I can't find it. The difference with this one is that the
individual elements are still resemmed.

This should fix the break caused by #24184 so we could redo it after
this PR but it might still have issues, not to mention the related
pre-existing issues like #22793, #12559 etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants