Closed metagn closed 1 year ago
It was meant for a transition period and it was used during this period successfully. Now it's time to let it die and make the compiler a tiny bit simpler (and faster) internally.
what's nimfix?
A tool that can do the "rename" refactoring feature automatically. It was used successfully back in the days and could be revived, but this doesn't require this pragma.
Packages caught in Nim CI that use the deprecated statement along with db_connector as mentioned above:
Since these are versioned, it may be fine to make PRs just removing these, since they've been there for a long time and it's not likely anyone uses the deprecated names.
Abstract
Get rid of the deprecated pragma statement syntax.
Motivation
This feature is redundant over the
deprecated
pragma next to definitions. It was added a very long time ago but never documented in the language spec (or its documentation was removed). It still had use cases for a while because 1. some kinds of symbols (like const) used to not support the pragma, which they now do, and 2. thenimfix
tool can automatically replace the old name with the new name (see description below for how to deal with this).The biggest reason to remove it though is the fact that it is the sole remaining user of the internal
skAlias
symbol kind which requiresskipAlias
calls everywhere in the compiler, and when some parts of the compiler forget to call it, it causes issues: https://github.com/nim-lang/Nim/issues/14819.Description
How to make
nimfix
still work:markUsed
template deprecatedReplace(newName: untyped) {.pragma.}
which thennimfix
would look for inmarkUsed
I vote 1 because 2 and 3 are way too opt-in and tedious to implement and I've never heard of anyone using nimfix.
Code Examples
Backwards Compatibility
Backwards incompatible for people who used this, but can use
when
and version check to work around.Only use I could find in the old Nim standard library was db_connector/mysql (used regex
deprecated\s*:\s*\[
). I don't think many people used this but it's still worth checking if they did.