Nim icon indicating copy to clipboard operation
Nim copied to clipboard

`=destroy` for non-var failed to compile when `nim doc`

Open litlighilit opened this issue 8 months ago • 4 comments

Description

A regression, maybe only occur in Nim 2.0.6, not in devel branch or 2.0.4

only causes compile-error when nim doc and other commands like nim c or nim check just work.

Simplest demo:

type O = object
proc `=destroy`*(self: O) = discard

Nim Version

Nim Compiler Version 2.0.6 [Windows: amd64] Compiled at 2024-06-17 Copyright (c) 2006-2023 by Andreas Rumpf active boot switches: -d:release

Current Output

Error: signature for '=destroy' must be proc[T: object](x: var T)

Expected Output

(compiles and no error reported)

Possible Solution

No response

Additional Information

I found it shown on nimpylib's test

litlighilit avatar Jun 17 '24 13:06 litlighilit