nim-lang / Nim

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

jsondoc broken in devel #23914

Closed PMunch closed 2 months ago

PMunch commented 2 months ago

Description

nim jsondoc system.nim
.tables.nim(232)          raiseKeyError
Error: unhandled exception: key not found: types [KeyError]

The same works fine in 2.0.8

Nim Version

Nim Compiler Version 2.1.9 [Linux: amd64]
Compiled at 2024-08-02
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 12b968029159ae05b9813095fbe671e4aa57922b
active boot switches: -d:release

Current Output

No response

Expected Output

No response

Possible Solution

No response

Additional Information

No response

ringabout commented 2 months ago

regression because of https://github.com/nim-lang/Nim/pull/23064

for kind in genericParam.sym.typ.sons:
  param["types"].add %($kind)

is not equivalent to

param["types"].add %($genericParam.sym.typ.elementType)

because genericParam.sym.typ.len can be 0

I will push my fix soon