Nim
Nim copied to clipboard
`methods` don't trigger `XDeclaredButNotUsed`
Nim Version
Nim Compiler Version 2.0.15 [Linux: amd64]
Compiled at 2025-03-24
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: d01002d8f8cf2c12e67e4ddae3e5990a7d92e753
active boot switches: -d:release
Nim Compiler Version 2.2.3 [Linux: amd64]
Compiled at 2025-03-24
Copyright (c) 2006-2025 by Andreas Rumpf
git hash: bfd25121f9e636f465fce296cf92554bb3288848
active boot switches: -d:release
Nim Compiler Version 2.3.1 [Linux: amd64]
Compiled at 2025-03-24
Copyright (c) 2006-2025 by Andreas Rumpf
git hash: fcba14707a06271f6e14b6c5641d6d5fbc96ff0d
active boot switches: -d:release
It's true that
Description
type J = ref object of RootObj
method u(_: J) {.base.} = discard
It's true that the point of methods is to use dynamic dispatch as opposed to static dispatch by default, but there's still no possible way this u method can be called.
Current Output
No XDeclaredButNotUsed
Expected Output
Known Workarounds
No response
Additional Information
No response