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.21k stars 1.46k forks source link

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

Open litlighilit opened 1 week ago

litlighilit commented 1 week ago

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 commented 1 week ago

As I tested, at least no error in Nim 2.1.1, 2.0.0, 2.0.4

litlighilit commented 1 week ago

!nim doc

type O = object
proc `=destroy`*(self: O) = discard
github-actions[bot] commented 1 week ago
:penguin: Linux bisect by @litlighilit (contributor)
devel :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp ```

Stats

  • Started 2024-06-17T13:23:08
  • Finished 2024-06-17T13:23:08
  • Duration now

AST

```nim ```
stable :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp ```

Stats

  • Started 2024-06-17T13:23:09
  • Finished 2024-06-17T13:23:09
  • Duration now

AST

```nim ```
2.0.4 :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp ```

Stats

  • Started 2024-06-17T13:23:12
  • Finished 2024-06-17T13:23:12
  • Duration now

AST

```nim ```
2.0.0 :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp ```

Stats

  • Started 2024-06-17T13:23:14
  • Finished 2024-06-17T13:23:14
  • Duration now

AST

```nim ```
1.6.20 :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp ```

Stats

  • Started 2024-06-17T13:23:17
  • Finished 2024-06-17T13:23:17
  • Duration now

AST

```nim ```
1.4.8 :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp ```

Stats

  • Started 2024-06-17T13:23:19
  • Finished 2024-06-17T13:23:19
  • Duration now

AST

```nim ```
1.2.18 :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp ```

Stats

  • Started 2024-06-17T13:23:21
  • Finished 2024-06-17T13:23:21
  • Duration now

AST

```nim ```
1.0.10 :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp ```

Stats

  • Started 2024-06-17T13:23:23
  • Finished 2024-06-17T13:23:23
  • Duration now

AST

```nim ```
Stats
  • GCC 11.4.0
  • Clang 14.0.0
  • NodeJS 20.3
  • Created 2024-06-17T13:16:43Z
  • Comments 2
  • Commands nim doc --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim

:robot: Bug found in 18 minutes bisecting 8 commits at 0 commits per second

juancarlospaco commented 1 week ago

I think theres no "!nim doc" in the bisect bot, I don't know what it should do 🤔 but ideas and pr welcome: https://github.com/juancarlospaco/nimrun-action