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

nim doc doesn't work when calling =destroy(x: var seq[T]) in =destroy(x: Foo) #23065

Closed
Clonkk opened this issue Dec 13, 2023 · 2 comments · Fixed by #23075
Closed

nim doc doesn't work when calling =destroy(x: var seq[T]) in =destroy(x: Foo) #23065

Clonkk opened this issue Dec 13, 2023 · 2 comments · Fixed by #23075
Assignees
Labels
Documentation Generation Related to documentation generation (but not content).

Comments

@Clonkk
Copy link
Contributor

Clonkk commented Dec 13, 2023

Description

type
  ## Foo type
  Foo* = object
    s: seq[int]

proc `=destroy`(foo: Foo) =
  `=destroy`(foo.s)

Compiling nim c|cpp foo.nim works. Trying to generate documentation using nim doc foo.nim fails.

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

[...]/foo.nim(7, 13) Error: type mismatch
Expression: `=destroy`(foo.s)
  [1] foo.s: seq[int]

Expected one of (first mismatch at [position]):
[1] proc `=destroy`(foo: Foo)
[1] proc `=destroy`[T](x: var T)

Expected Output

If the code compiles, then the documentation generation should too. Either both should fail or both should work.

@ringabout
Copy link
Member

Probably, it is a bug of documentation generation: nim doc --mm:orc test6.nim seems to work for me

@Clonkk
Copy link
Contributor Author

Clonkk commented Dec 13, 2023

I thought --mm:orc was the default configuration if you specified nothing.

Anyway, thanks for the workaround

@ringabout ringabout added the Documentation Generation Related to documentation generation (but not content). label Dec 13, 2023
Araq pushed a commit that referenced this issue Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Generation Related to documentation generation (but not content).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants