Bug 14858 - Stable Release of XS with Support iOS 7 Compiler Warning Bug
Summary: Stable Release of XS with Support iOS 7 Compiler Warning Bug
Status: RESOLVED FEATURE
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2013-09-19 11:39 UTC by Kevin Mullins
Modified: 2015-08-31 08:37 UTC (History)
2 users (show)

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

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 Kevin Mullins 2013-09-19 11:39:16 UTC
Before the stable release this chunk of code used to compile fine:

    /// <summary>
    /// Returns the bounds for the device's <c>MainScreen</c> adjusted to fit the current <c>UIInterfaceOrientation</c>
    /// </summary>
    /// <value>The rotated screen bounds.</value>
    internal static RectangleF RotatedScreenBounds{
        get {
            RectangleF bounds;

            //Adjust view to match current interface orientation
            switch (currentDeviceOrientation) {
            case UIInterfaceOrientation.LandscapeLeft:
            case UIInterfaceOrientation.LandscapeRight:
                bounds = new RectangleF (0, 0, UIScreen.MainScreen.Bounds.Height, UIScreen.MainScreen.Bounds.Width);
                break;
            case UIInterfaceOrientation.Portrait:
            case UIInterfaceOrientation.PortraitUpsideDown:
                bounds = new RectangleF (0, 0, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height);
                break;
            }

            //Return results
            return bounds;
        }
    }

Now I get an error at return bounds; that say Use of unassigned local variable 'bounds' even though all paths through the case statement set a value to bounds.

Note that this code worked correctly before.
Comment 1 Marek Safar 2015-08-31 08:37:08 UTC
The error message is correct. You are setting bounds for 4 cases only but there are int.MaxValue - 4 other cases.