Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WONTFIX] {.deprecated. [oldName: newName]} pragma for parameter names #8313

Closed
timotheecour opened this issue Jul 14, 2018 · 0 comments
Closed
Labels

Comments

@timotheecour
Copy link
Member

nim has a syntax to indicate deprecated symbols and also generate automated code upgrade using nimfix:
eg, for a type:

{.deprecated: [TSocketHandle: SocketHandle].} # see https://nim-lang.org/docs/manual.html#pragmas-deprecated-pragma

likewise for procs.

Could that syntax be extended to proc parameters?

that way, ill-named parameters can be renamed with minimal impact.

The alternative we've been using (IIRC) is to not consider param name changes as breaking changes, according to #8306 (comment) :

The argument about making it easier to deprecate/add named parameters is really important IMO. It's currently unclear when it's "safe" to use named parameters when calling third-party code, since renaming a parameter is typically not treated as a breaking change

but the fact of the matter is whenever code calls the proc with keyword instead of positional, code will break.

With this suggestion, code will not break, but generate a warning, and can be automatically ugpraded via nimfix.

@timotheecour timotheecour changed the title {.deprecated. [oldName: newName]} pragma for parameter names [WONTFIX] {.deprecated. [oldName: newName]} pragma for parameter names Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants