Skip to content

Comments

Modify -transition=safe usage to comply with deprecation process#6183

Merged
WalterBright merged 3 commits intodlang:stablefrom
mihails-strasuns:transition-safe-into-deprecation
Oct 9, 2016
Merged

Modify -transition=safe usage to comply with deprecation process#6183
WalterBright merged 3 commits intodlang:stablefrom
mihails-strasuns:transition-safe-into-deprecation

Conversation

@mihails-strasuns
Copy link

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.

Instead of hiding new functionality it now warns about hidden
semantical changes in existing code when it can't be handled
by a deprecation.
@mihails-strasuns mihails-strasuns changed the title Modify -transition=sage usage to comply with deprecation process Modify -transition=safe usage to comply with deprecation process Oct 8, 2016
Dicebot added 2 commits October 8, 2016 20:21
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.
@mihails-strasuns
Copy link
Author

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.

@MartinNowak MartinNowak added this to the 2.072.0 milestone Oct 9, 2016
@WalterBright
Copy link
Member

WalterBright commented Oct 9, 2016

I'm not sure about f55b4d9 either, but we can give it a try.

@WalterBright WalterBright merged commit e5fd779 into dlang:stable Oct 9, 2016
if (global.params.safe)
fld.tookAddressOf = 1; // allocate a closure unless the opApply() uses 'scope'
{
fprintf(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will print the message only with -transition=safe flag. Or am I misunderstanding?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh indeed. Yes that name is a bit misleading. I rest my case then.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should prolly extend our deprecation/error API for such messages.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean to add dedicated "information" method to be used from -transition switches?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants