Modify -transition=safe usage to comply with deprecation process#6183
Modify -transition=safe usage to comply with deprecation process#6183WalterBright merged 3 commits intodlang:stablefrom mihails-strasuns:transition-safe-into-deprecation
Conversation
Instead of hiding new functionality it now warns about hidden semantical changes in existing code when it can't be handled by a deprecation.
As a bug fix that results in breaking change, it must be a subject to normal deprecation process.
Such bug fix is hard to hide behind a deprecation warning as it affects runtime behaviour without causing direct compilation failure, thus extra migration help is provided via -transition=safe.
|
Green. Change in f55b4d9 is probably most questionable as it is related to code gen change and there is no 100% proven way to handle those yet. |
|
I'm not sure about f55b4d9 either, but we can give it a try. |
| if (global.params.safe) | ||
| fld.tookAddressOf = 1; // allocate a closure unless the opApply() uses 'scope' | ||
| { | ||
| fprintf( |
There was a problem hiding this comment.
Won't that print a message regardless of any switch ? Having an uncategorized message you cannot disable when someone is using a feature doesn't seem like the best approach to me.
There was a problem hiding this comment.
It will print the message only with -transition=safe flag. Or am I misunderstanding?
There was a problem hiding this comment.
Ah, probably it is the current name of it (global.params.safe) that mislead you. I should rename it now that its purpose has been changed to be a transitional helper.
There was a problem hiding this comment.
Oh indeed. Yes that name is a bit misleading. I rest my case then.
There was a problem hiding this comment.
We should prolly extend our deprecation/error API for such messages.
There was a problem hiding this comment.
You mean to add dedicated "information" method to be used from -transition switches?
Adjusts changes from 3 commits (9f3e721 354c326 f7819c8) to use standard deprecation process for breaking changes instead of hiding new functionality behind compiler switch.
There is another commit it master (3421336) that will have to adjusted accordingly.