[Mono-bugs] [Bug 71819][Maj] New - crazy boolean in mcs and gmcs (head and 1.05)

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 26 Jan 2005 16:57:54 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by spigaz@gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=71819

--- shadow/71819	2005-01-26 16:57:54.000000000 -0500
+++ shadow/71819.tmp.30092	2005-01-26 16:57:54.000000000 -0500
@@ -0,0 +1,83 @@
+Bug#: 71819
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: Gentoo 2.6.10
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: spigaz@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: crazy boolean in mcs and gmcs (head and 1.05)
+
+Description of Problem:
+
+In some strange circunstance, a bool value, given true to the method, is
+recived inside the method as false.
+
+In the example, the v4 is always given true, but is always recived as false.
+
+
+Steps to reproduce the problem:
+1. Insert into a file:
+
+namespace FLMID.Bugs.BoolOne
+{
+	public interface IB
+	{
+		void Add(bool v1, bool v2, uint v3, bool v4);
+	}
+	
+	public class A
+	{
+		public void Add(bool v1, bool v2, uint v3, bool v4)
+		{
+			System.Console.WriteLine(v4);
+		}
+	}
+
+	public class B : A, IB
+	{
+	}
+
+	public class Test
+	{
+		public static void Main(string[] args)
+		{
+			IB aux = new B();
+			
+			aux.Add(false, false, 0, true);	
+		}
+	}
+}
+
+2. Compile
+3. Execute
+
+Actual Results:
+False
+
+Expected Results:
+True
+
+How often does this happen? 
+Always
+
+Additional Information:
+Tested in .NET 2.0 (Beta) and it worked fine
+
+If you define a method in the subclasse like this: 
+(and put the base class' virtual)
+
+public override void Add(bool v1, bool v2, uint v3, bool v4)
+{
+  base.Add(v1, v2, v3, v4);
+}
+
+It will work fine. So far this is the only workarround that I have found...