Add option to show deprecated errors as warnings #248

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
5 participants
@michelf
Contributor

michelf commented Jul 13, 2011

The new option -di treats deprecation errors as informational warnings,
just like -wi show warnings as informational messages without triggering
errors.

The deprecation option uses the same mechanism as warnings use, so the
same counter (globals.warnings) is shared for both regular and deprecation
warnings (when -di is in use). Some methods that print there own errors
now use the global function error() to print them. There is a particular
case in the Lexer where errors are not triggered but counted, in that case
the same is done with deprecation warnings, asuming it was intended
behaviour.

llucax added some commits Jul 12, 2011

Add option to show deprecated errors as warnings
The new option -di treats deprecation errors as informational warnings,
just like -wi show warnings as informational messages without triggering
errors.

The deprecation option uses the same mechanism as warnings use, so the
same counter (globals.warnings) is shared for both regular and deprecation
warnings (when -di is in use). Some methods that print there own errors
now use the global function error() to print them. There is a particular
case in the Lexer where errors are not triggered but counted, in that case
the same is done with deprecation warnings, asuming it was intended
behaviour.
Make deprecated() smarter
The deprecated() function now checks if a deprecation message should be
emitted at all, so you can now call deprecated() without checking if
global.params.deprecation is not 0 yourself. This makes code easier to
write and read.

Also restore some error messages that had "deprecated" in them but were
really plain errors (things that are not longer legal at all, not just
deprecated).
@llucax

This comment has been minimized.

Show comment
Hide comment
@llucax

llucax Dec 1, 2011

Contributor

I also created a bug report for this: http://d.puremagic.com/issues/show_bug.cgi?id=7041

Contributor

llucax commented Dec 1, 2011

I also created a bug report for this: http://d.puremagic.com/issues/show_bug.cgi?id=7041

@WalterBright

This comment has been minimized.

Show comment
Hide comment
@WalterBright

WalterBright Feb 1, 2012

Member

We already have so many options for deprecation and warnings, I am hard pressed to agree that adding more will help more than just add complexity.

Member

WalterBright commented Feb 1, 2012

We already have so many options for deprecation and warnings, I am hard pressed to agree that adding more will help more than just add complexity.

@llucax

This comment has been minimized.

Show comment
Hide comment
@llucax

llucax Feb 2, 2012

Contributor

I replied to the bug report because I think is better to track the issue there:
http://d.puremagic.com/issues/show_bug.cgi?id=7041

If you feel more comfortable discussing things here let me know.

Contributor

llucax commented Feb 2, 2012

I replied to the bug report because I think is better to track the issue there:
http://d.puremagic.com/issues/show_bug.cgi?id=7041

If you feel more comfortable discussing things here let me know.

@llucax

This comment has been minimized.

Show comment
Hide comment
@llucax

llucax Apr 25, 2012

Contributor

Please see this pullrequest:
D-Programming-Language#908

It only includes the patch adding the deprecation() function. I think is good independently of the discussion about adding deprecations as warnings.

Contributor

llucax commented Apr 25, 2012

Please see this pullrequest:
D-Programming-Language#908

It only includes the patch adding the deprecation() function. I think is good independently of the discussion about adding deprecations as warnings.

@WalterBright

This comment has been minimized.

Show comment
Hide comment
@WalterBright

WalterBright Sep 5, 2012

Member

I appreciate that you redid it to just add the deprecation function, but it just seems overly complex without any noticable benefit.

Member

WalterBright commented Sep 5, 2012

I appreciate that you redid it to just add the deprecation function, but it just seems overly complex without any noticable benefit.

@nazriel

This comment has been minimized.

Show comment
Hide comment
@nazriel

nazriel Oct 7, 2012

Contributor

What about this? It's 1 year old PR and nothing is happening here.
Also I think it was superseded by D-Programming-Language#908
@braddr @yebblies ping

Contributor

nazriel commented Oct 7, 2012

What about this? It's 1 year old PR and nothing is happening here.
Also I think it was superseded by D-Programming-Language#908
@braddr @yebblies ping

@yebblies

This comment has been minimized.

Show comment
Hide comment
@yebblies

yebblies Oct 7, 2012

Member

@nazriel Pull #908 was only part of this one, and Walter is against adding this switch. The pull itself will be much easier to review once it has been rebased.

Member

yebblies commented Oct 7, 2012

@nazriel Pull #908 was only part of this one, and Walter is against adding this switch. The pull itself will be much easier to review once it has been rebased.

@nazriel

This comment has been minimized.

Show comment
Hide comment
@nazriel

nazriel Oct 7, 2012

Contributor

@yebblies yea, I am just afraid that @michelf is out (notice 0 comments about this PR, or any replies to Walter's opinion about switch). Also I think it was a reason why Leandro created D-Programming-Language#908 . So it may be a dead, rotting PR

Let's ping @michelf once again ;)

Contributor

nazriel commented Oct 7, 2012

@yebblies yea, I am just afraid that @michelf is out (notice 0 comments about this PR, or any replies to Walter's opinion about switch). Also I think it was a reason why Leandro created D-Programming-Language#908 . So it may be a dead, rotting PR

Let's ping @michelf once again ;)

@michelf

This comment has been minimized.

Show comment
Hide comment
@michelf

michelf Oct 7, 2012

Contributor

All but @nazriel's latest comment (the one with a @michelf) related to this pull request in the last 8 month never landed on my inbox. Perhaps my Github email settings are wrong. I'll look at this.

To put things in context: this pull request comes from a patch sent to the mailing list by @llucax who at the time had no Github account (look who is the author of those commits). I haven't replied here because @llucax finally got a Github account and seemed to do a good job at replying. And since I never saw Walter's last comment (because of broken email notifications) I didn't follow through either when it was left unanswered.

Assuming someone intend to salvage some remaining parts of this pull request (those not in pull #908), I think it'd be best if it was made as a separate pull request. I'll therefore close this request.

Contributor

michelf commented Oct 7, 2012

All but @nazriel's latest comment (the one with a @michelf) related to this pull request in the last 8 month never landed on my inbox. Perhaps my Github email settings are wrong. I'll look at this.

To put things in context: this pull request comes from a patch sent to the mailing list by @llucax who at the time had no Github account (look who is the author of those commits). I haven't replied here because @llucax finally got a Github account and seemed to do a good job at replying. And since I never saw Walter's last comment (because of broken email notifications) I didn't follow through either when it was left unanswered.

Assuming someone intend to salvage some remaining parts of this pull request (those not in pull #908), I think it'd be best if it was made as a separate pull request. I'll therefore close this request.

@michelf michelf closed this Oct 7, 2012

@llucax

This comment has been minimized.

Show comment
Hide comment
@llucax

llucax Oct 7, 2012

Contributor

@michelf thanks for creating this pull request for me btw. I will create a new one updated, with #908 fixed and deprecated("message") already merged in I hope Walter rethink about this and we can finally have a really useful deprecated feature in the language.

Contributor

llucax commented Oct 7, 2012

@michelf thanks for creating this pull request for me btw. I will create a new one updated, with #908 fixed and deprecated("message") already merged in I hope Walter rethink about this and we can finally have a really useful deprecated feature in the language.

@llucax

This comment has been minimized.

Show comment
Hide comment
@llucax

llucax Oct 15, 2012

Contributor

Superseded by pull #1185 now.

Contributor

llucax commented Oct 15, 2012

Superseded by pull #1185 now.

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