Bug 5303 - Serious runtime issue? Debugger: assignment of int not working. Target value remains unchanged
Summary: Serious runtime issue? Debugger: assignment of int not working. Target value ...
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Debugger ()
Version: 5.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-05-24 11:11 UTC by René Ruppert
Modified: 2015-06-26 13:06 UTC (History)
4 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 Developer Community or GitHub 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 FIXED

Description René Ruppert 2012-05-24 11:11:18 UTC
MonoTouch 5.2.11, Simulator 5.0

Please watch the video on Screencast. 

http://screencast.com/t/GvSVCSS1es3

I have a class that holds:

public int Page { get; set; }

In a foreach loop the Page property gets assigned to an int:

int iPage = oAnnot.Page;

In all iterations of the loop, oAnnot.Page == 1.
But after assigning it to iPage, iPage is always zero!
This messes up the dictionary I'm trying to fill.

Very weird bug and I hope it is in the debugger only and not on the device during runtime.
Comment 1 René Ruppert 2012-05-24 11:23:49 UTC
Hm, I found the cause, but still weird. The "Page" property already existed in the base class. So the one I added was overwriting the one of the base. Still the debugger showed the one from the base, but during assignment, the one form the inheriting class was used and that was never set (0).
Comment 2 Zoltan Varga 2012-05-24 12:53:43 UTC
I can't reproduce this. Can you attach a test project ?
Comment 3 René Ruppert 2012-05-25 06:44:06 UTC
I'm currently not near a Mac, but you'll need the following preconditions:


1. Have a base (BaseClass) class with a poperty "public int Value {get;set;}".
2. Have a class InheritedClass : BaseClass. Also give it a property "public int Value {get;set;}", so that the compiler will warn you that you are hiding the property.
3. Create an instance of InheritedClass but assign it to BaseClass: BaseClass oSpecialized = new InheritedClass();
4. Try int i = oSpecialized.Value; and check the debugger like I did.
Comment 4 Zoltan Varga 2012-05-25 08:15:02 UTC
I can't reproduce this using these instructions. Maybe it got fixed in the meantime.
Comment 5 David Karlaš 2015-06-26 13:06:21 UTC
Since video is not available anymore I followed instructions from Comment 3 and I can't reproduce this.
Since 3 years passed this must be fixed already, hence closing.

If it's still happening, reopen...