Bug 42690 - Compiler fails to warn for Obsolete member
Summary: Compiler fails to warn for Obsolete member
Status: RESOLVED FEATURE
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: 4.4.0 (C7)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2016-07-20 15:39 UTC by Jonathan Chambers
Modified: 2016-07-26 15:21 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: Yes
Last known good build:


Attachments
Test case (313 bytes, text/plain)
2016-07-20 15:39 UTC, Jonathan Chambers
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FEATURE

Description Jonathan Chambers 2016-07-20 15:39:45 UTC
Created attachment 16732 [details]
Test case

Run the attached test case.

Output from csc:

Main.cs(6,9): error CS0619: 'Test.Value' is obsolete: 'Foo'
Main.cs(6,17): error CS1061: 'object' does not contain a definition for 'other'and no extension method 'other' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
Main.cs(15,9): error CS0619: 'Test.Value' is obsolete: 'Foo'
Main.cs(15,15): error CS1061: 'object' does not contain a definition for 'other' and no extension method 'other' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)

Output from mcs:
Main.cs(6,11): error CS0619: `Test.Value' is obsolete: `Foo'
Main.cs(6,17): error CS1061: Type `object' does not contain a definition for `other' and no extension method `other' of type `object' could be found. Are you missing an assembly reference?
C:\Users\Jonathan\Development\unity1\External\MonoBleedingEdge\builds\monodistribution\lib\mono\4.5\mscorlib.dll (Location of the symbol related to previous error)
Main.cs(15,15): error CS1061: Type `object' does not contain a definition for `other' and no extension method `other' of type `object' could be found. Are you missing an assembly reference?
C:\Users\Jonathan\Development\unity1\External\MonoBleedingEdge\builds\monodistribution\lib\mono\4.5\mscorlib.dll (Location of the symbol related to previous error)
Compilation failed: 3 error(s), 0 warnings

mcs is missing the Obsolete error for line 15
Comment 1 Marek Safar 2016-07-26 15:21:25 UTC
The error is reported when correct member name is used