Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2011-11-16 18:16:35 +0400
committerMarek Safar <marek.safar@gmail.com>2011-11-16 18:18:15 +0400
commit07eff27570030d6be6496ff0b4b02f7f999275b6 (patch)
tree7ce67aa006b269e27eb913c2d1e4d75787858b18 /mcs/tests/test-833.cs
parentd47f21331eec625c04df14dd01fa874f5afc38bd (diff)
Don't release temporrary instance variable prematurely. Fixes #2011
Diffstat (limited to 'mcs/tests/test-833.cs')
-rw-r--r--mcs/tests/test-833.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/mcs/tests/test-833.cs b/mcs/tests/test-833.cs
new file mode 100644
index 00000000000..3b2fa888a96
--- /dev/null
+++ b/mcs/tests/test-833.cs
@@ -0,0 +1,33 @@
+using System;
+
+class MainClass
+{
+ public struct DC
+ {
+ private readonly Guid m_Id;
+
+ public DC (Guid Id)
+ {
+ m_Id = Id;
+ }
+
+ public Guid Id
+ {
+ get { return m_Id; }
+ }
+
+
+ }
+
+ public static int Main ()
+ {
+ Guid Id = Guid.NewGuid ();
+ DC dc = new DC (Id);
+ Console.WriteLine ("id: {0} default: {1}", Id, default (Guid));
+ if (dc.Id.Equals (default (Guid)))
+ return 1;
+
+ return 0;
+ }
+}
+