4

I have two functions: Method(A val) and Method(B val), one taking val of type A and the other of type B.

I want to mark Method(A val) obsolete, so that IDE can highlight the fact that it's obsolete.

I have decorated the method with [Obsolete], however, am not seeing it as deprecated.

Am I missing something? From my research, I have only seen examples of creating a brand new method to replace the old one but not seen any example of a overloaded function taking place of the older deprecated one. Any help would be highly appreciated.

Klinger
  • 4,900
  • 1
  • 30
  • 35
user420
  • 131
  • 2
  • 12
  • 2
    possible duplicate of [How to mark a class as Deprecated?](http://stackoverflow.com/questions/314505/how-to-mark-a-class-as-deprecated) – Mike Perrenoud Apr 10 '14 at 14:32
  • 3
    @MichaelPerrenoud That's not a duplicate. He is already using the appropriate attribute, as is described in that post's answers. – Servy Apr 10 '14 at 14:33
  • 1
    @Servy, though the OP didn't post the code, it's just about certain the OP isn't using the right overload. That question has another one associated with it as a duplicate as well that breaks down the three overloads. – Mike Perrenoud Apr 10 '14 at 14:34
  • 2
    @MichaelPerrenoud Well then for starters you could propose *that* as a duplicate, instead of a question that includes information that the OP has already stated he's using, and even so, I still fail to see an explanation of the OP's solution in those answers. – Servy Apr 10 '14 at 14:36
  • 1
    @Servy, I guess I could, but I'm figuring the OP has that much ability. – Mike Perrenoud Apr 10 '14 at 14:38
  • @MichaelPerrenoud As per my edit, having found the post you're referring to, that *still* doesn't address the OP's question. – Servy Apr 10 '14 at 14:38
  • 1
    @Servy, okay, well I guess that's why it's a *possible duplicate*. But I have yet to hear from you any solutions. What is it you propose I or the OP do? What is it *you think* will solve the issue? – Mike Perrenoud Apr 10 '14 at 14:40

2 Answers2

7

Intellisense doesn't consider just a single overload depreciated; it considers an entire method deprecated in what it shows.

If we look at the entire method's Intellisense popup:

enter image description here

compared to the popup for a particular overload:

enter image description here

But the key point is that once we have a completed call to the method, the deprecated overload results in a warning (or error):

enter image description here

while the other does not:

enter image description here

Klinger
  • 4,900
  • 1
  • 30
  • 35
Servy
  • 202,030
  • 26
  • 332
  • 449
0

In the other answer, user "Servy" provides the details on what's going on with intellisense - it's grouping them together in the drop down and any overload being obsolete marks it as obsolete. I'll propose using the EditorBrowsable attribute to hide the deprecated version in the editor (intellisense).

TheSoftwareJedi
  • 34,421
  • 21
  • 109
  • 151