2008-01-24 Marek Safar <marek.safar@gmail.com>
authorMarek Safar <marek.safar@gmail.com>
Thu, 24 Jan 2008 10:32:23 +0000 (10:32 -0000)
committerMarek Safar <marek.safar@gmail.com>
Thu, 24 Jan 2008 10:32:23 +0000 (10:32 -0000)
A test for bug #355163

svn path=/trunk/mcs/; revision=93784

mcs/tests/gtest-364.cs [new file with mode: 0644]

diff --git a/mcs/tests/gtest-364.cs b/mcs/tests/gtest-364.cs
new file mode 100644 (file)
index 0000000..4b9662e
--- /dev/null
@@ -0,0 +1,38 @@
+using System;
+
+namespace BugReport
+{
+       class Program
+       {
+               static int Main()
+               {
+                       A a = new A();
+                       a.Counter++;
+                       if (a.Counter != null)
+                               return 1;
+                       ++a.Counter;
+                       if (a.Counter != null)
+                               return 2;
+                       
+                       a.Counter = 0;
+                       a.Counter++;
+                       if (a.Counter != 1)
+                               return 3;
+                       ++a.Counter;
+                       if (a.Counter != 2)
+                               return 4;
+                       
+                       Console.WriteLine ("OK");
+                       return 0;
+               }
+       }
+
+       class A {
+               private int? _counter;
+               public int? Counter {
+                       get { return _counter; }
+                       set { _counter = value; }
+               }
+       }
+}
+