Skip to content

Regression from version-1-6 to version-2-0/version-2-2/devel with mutually recursive functions and Error: n(t) can raise an unlisted exception: Exception #24765

@tersec

Description

@tersec

Nim Version

Builds and runs:

Nim Compiler Version 1.6.21 [Linux: amd64]
Compiled at 2025-03-10
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: ec324ad0736c3e0cfa26b64d6631b15693633a6f
active boot switches: -d:release

Does not bulid:

Nim Compiler Version 2.0.15 [Linux: amd64]
Compiled at 2025-03-10
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 41637db18f6a82df4a92f2e00a780e5815d17028
active boot switches: -d:release
Nim Compiler Version 2.2.3 [Linux: amd64]
Compiled at 2025-03-10
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: 9cf0d07b9e1e21ecbee8796bda7d3cedb9196dc9
active boot switches: -d:release
Nim Compiler Version 2.3.1 [Linux: amd64]
Compiled at 2025-03-10
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: f8294ce06e61752d15624e0422c5296292ef5467
active boot switches: -d:release

Description

proc n(d: var int)

proc s(p: int|int) {.raises: [CatchableError].} =
  var t: int
  if false: n(t)

proc n(d: var int) = s(0)

Current Output

/tmp/w.nim(7, 23) template/generic instantiation of `s` from here
/tmp/w.nim(3, 30) template/generic instantiation from here
/tmp/w.nim(5, 14) Error: n(t) can raise an unlisted exception: Exception

Expected Output


Known Workarounds

No response

Additional Information

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions