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

jsondoc IndexDefect with auto return type #24744

Open
ire4ever1190 opened this issue Mar 2, 2025 · 0 comments
Open

jsondoc IndexDefect with auto return type #24744

ire4ever1190 opened this issue Mar 2, 2025 · 0 comments

Comments

@ire4ever1190
Copy link
Contributor

Nim Version

Nim Compiler Version 2.3.1 [Linux: amd64]
Compiled at 2025-02-28
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: 7e8a650
active boot switches: -d:release

Description

Running jsondoc (but not doc) fails with this example

# Only works with unrestrained types like `ref` and `proc`. Normal generic doesn't fail
proc test*(x: ref): auto = ""

Current Output

nim/compiler/nim.nim(169) nim
nim/compiler/nim.nim(124) handleCmdLine
nim/compiler/main.nim(353) mainCommand
nim/compiler/main.nim(118) commandDoc2
nim/compiler/pipelines.nim(311) compilePipelineProject
nim/compiler/pipelines.nim(231) compilePipelineModule
nim/compiler/pipelines.nim(178) processPipelineModule
nim/compiler/pipelines.nim(42) processPipeline
nim/compiler/docgen2.nim(61) processNodeJson
nim/compiler/docgen.nim(1580) generateJson
nim/compiler/docgen.nim(1210) genJsonItem
nim/compiler/types.nim(792) typeToString
nim/compiler/types.nim(714) typeToString
nim/compiler/ast.nim(1329) elementType
nim/lib/system/indices.nim(30) []
nim/lib/system/fatal.nim(53) sysFatal
Error: unhandled exception: index out of bounds, the container is empty [IndexDefect]

Expected Output

Doesn't crash

Known Workarounds

No response

Additional Information

No response

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

No branches or pull requests

1 participant