question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Obsolete warning isn't produced for some obsolete symbol usages

See original GitHub issue
[Obsolete("Class is obsolete")]
public class ObsoleteClass
{
}
let c1: ObsoleteClass = null
let c2 = ObsoleteClass()

Two warnings are expected, but only one is produced: Screenshot 2022-07-14 at 13 24 24

C# compiler produces two warnings:

ObsoleteClass c = new ObsoleteClass();
Screenshot 2022-07-14 at 13 27 20

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
edgarfgpcommented, Oct 11, 2022
1reaction
edgarfgpcommented, Jul 14, 2022

@vzarytovskii @auduchinok

Is it on the main, or latest stable? I remember @edgarfgp was doing some changes there?

I think is in main

It’s in 6.0.301 and in FCS from ~March.

My changes where June 13 https://github.com/dotnet/fsharp/pull/13257 (See the testing scenarios to see this is fixed) And it did address some of the inconsistencies . But there are still some pending like https://github.com/dotnet/fsharp/issues/6628 and https://github.com/dotnet/fsharp/issues/11529

let c1: ObsoleteClass = null
let c2 = ObsoleteClass()

Try adding new before the class name ?

let c2 = new ObsoleteClass()

I think we can add more testing to validate this behaviours and see what is still missing ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Selectively suppress custom Obsolete warnings
I'm using the Obsolete attribute (as just suggested by fellow programmers) to show a warning if a certain method is used. Is there...
Read more >
Obsolete features in .NET 5+
Diagnostic ID Warning or error Description SYSLIB0005 Warning The global assembly cache (GAC) is not supported. SYSLIB0025 Warning SuppressIldasmAttribute has no effect in .NET 6+....
Read more >
Warning control — Python 3.11.4 documentation
For example, one might want to issue a warning when a program uses an obsolete module. Python programmers issue warnings by calling the...
Read more >
Obsolete (Warning as Errors) No Errors shown
I made a new minimal ReproWhen a Obselete Attribute has a newline in it, the Csharp compiler crashes when trying to display this...
Read more >
Deprecated and obsolete features - JavaScript - MDN Web Docs
This page lists features of JavaScript that are deprecated (that is, still available but planned for removal) and obsolete (that is, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found