Nim icon indicating copy to clipboard operation
Nim copied to clipboard

`proc v[T: typedesc]() = discard` / `v[0]()` compiles even though `0` isn't a `typedesc`

Open tersec opened this issue 1 month ago • 0 comments

Nim Version

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

git hash: f7145dd26efeeeb6eeae6fff649db244d81b212d
active boot switches: -d:release
Nim Compiler Version 2.2.6 [Linux: amd64]
Compiled at 2025-11-05
Copyright (c) 2006-2025 by Andreas Rumpf

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

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

Description

proc v[T: typedesc]() = discard
v[0]()

Current Output

Compiles

Expected Output

Compilation error due to 0 not being a `typedesc`

Known Workarounds

No response

Additional Information

No response

tersec avatar Nov 05 '25 18:11 tersec