Bug 3764 - Would like compiler warnings when using API that is higher than my target
Summary: Would like compiler warnings when using API that is higher than my target
Alias: None
Product: iOS
Classification: Xamarin
Component: General (show other bugs)
Version: master
Hardware: Macintosh Windows
: Normal enhancement
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
Depends on:
Reported: 2012-03-06 02:31 UTC by John Hair
Modified: 2017-05-18 12:26 UTC (History)
5 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:


Description John Hair 2012-03-06 02:31:06 UTC
Feature Request
Id like to see compiler warnings (configurable) when using API that is for a higher version than I am targetting. I would then want to be able to break my build on warnings and then gracefully handle the lower functional ability of iOS 4 whilst still using the iOS 5 API. I can do this with extension methods with ignore warning flags, for example.

Example: Lets say Im using class1 that has a number of properties. class1.GetMeANumber() is marked as iOS 5 and above, but Im targeting iOS 4. 
If I use class1.GetMeANumber() I want my build to break on a warning, *except* where I specifically say its ok. That would mean Im totally aware of any API's Im using, and can offer appropriately reduced functionality where required.

Comment 1 Rolf Bjarne Kvinge [MSFT] 2016-03-16 11:04:51 UTC
@Jeff, isn't this something that should be done in the IDE using whatever source analysis is able to provide?
Comment 2 Jeffrey Stedfast 2016-03-16 11:10:39 UTC
I thought he wanted it to break the build?
Comment 3 Rolf Bjarne Kvinge [MSFT] 2016-03-16 11:14:27 UTC
You can configure source analysis to show errors instead of warnings.
Comment 5 Vincent Dondain [MSFT] 2017-05-18 12:26:24 UTC
We acknowledge this enhancement request, therefore marked it as CONFIRMED.

However this does not necessarily mean we will take actions on it as we still need to discuss its feasibility internally and make sure it is not conflicting with other features.

About feasibility for instance, the roslyn analyser current does not understand when a given API is covered by an availability check.

Note You need to log in before you can comment on or make changes to this bug.