digitalmars.D - Enhancing of deprecation feature
- Andrey Zherikov (21/21) Nov 03 2021 Is it possible to enhance the deprecation mechanism that we
- zjh (3/5) Nov 03 2021 Good Idea ,helps auto patch into `new version`.
Is it possible to enhance the deprecation mechanism that we currently have through `deprecated` attribute in a way that the source code can provide how the caller should look like to migrate off the deprecated API? Something like this: ```d void bar(string param) { } deprecated("Use bar", (string[] args) => ["bar(", args.join(", "), ")"].join) void foo(string param) { bar(param); } foo("text"); // Deprecation: function `foo` is deprecated - Use bar: // bar("text") ``` Then DMD can have a special mode where it replaces deprecated code in place allowing easy migration to newer API, so `foo("text")` is substituted with `bar("text")`.
Nov 03 2021
On Thursday, 4 November 2021 at 04:19:35 UTC, Andrey Zherikov wrote:Is it possible to enhance the deprecation mechanism that we currently have through `deprecated` attribute in a way that theGood Idea ,helps auto patch into `new version`.
Nov 03 2021