Bug 52653 - Likely wrong enum value displayed
Summary: Likely wrong enum value displayed
Status: CONFIRMED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Debugger (show other bugs)
Version: Trunk
Hardware: PC Mac OS
: Low minor
Target Milestone: master
Assignee: David Karlaš
URL:
Depends on:
Blocks:
 
Reported: 2017-02-21 22:44 UTC by Vincent Dondain [MSFT]
Modified: 2017-05-25 19:49 UTC (History)
3 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 for Bug 52653 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Vincent Dondain [MSFT] 2017-02-21 22:44:26 UTC

    
Comment 1 Vincent Dondain [MSFT] 2017-02-21 22:49:50 UTC
Oops pressed enter by mistake, here's the description:

Please compare the results of both enums:

Case 1:

enum HMCharacteristicValueContactState
{
	// Obsolete
	Detected2 = 0,
	None = Detected2,
	// Obsolete
	Detected = 1,
	None2 = Detected,
}

Result for Console.Writeline:

HMCharacteristicValueContactState.None = None
HMCharacteristicValueContactState.Detected2 = None
HMCharacteristicValueContactState.Detected = Detected
HMCharacteristicValueContactState.None2 = Detected

I'd expect the following output:

HMCharacteristicValueContactState.None = Detected2
HMCharacteristicValueContactState.Detected2 = Detected2
HMCharacteristicValueContactState.Detected = Detected
HMCharacteristicValueContactState.None2 = Detected

-----

Case 2:

enum HMCharacteristicValueContactState
{
	// Obsolete
	None = 0,
	Detected2 = None,
	// Obsolete
	Detected = 1,
	None2 = Detected,
}

Result for Console.Writeline:

HMCharacteristicValueContactState.None = Detected2
HMCharacteristicValueContactState.Detected2 = Detected2
HMCharacteristicValueContactState.Detected = Detected
HMCharacteristicValueContactState.None2 = Detected

Basically in case 2 I would expect the following result:

HMCharacteristicValueContactState.None = None
HMCharacteristicValueContactState.Detected2 = None
HMCharacteristicValueContactState.Detected = Detected
HMCharacteristicValueContactState.None2 = Detected

See how the first 2 results seem wrong and the last 2 seem correct?

Let me know if there's a logical explanation to this or if it's a real bug.
Comment 2 Mike Krüger 2017-03-01 08:09:02 UTC
btw. my test case:

using System;

enum HMCharacteristicValueContactState
{
	// Obsolete
	Detected2 = 0,
	None = Detected2,
	// Obsolete
	Detected = 1,
	None2 = Detected,
}

class Test
{
	public static void Main(string[] args)
	{
		var e = HMCharacteristicValueContactState.Detected2;
		Console.WriteLine(e);
	}
}


Break point on e - our info & writeline differs.