Author: raja
Date: 2005-10-11 08:43:07 -0400 (Tue, 11 Oct 2005)
New Revision: 51562
Added:
trunk/mcs/tests/gtest-212.cs
trunk/mcs/tests/gtest-213.cs
Modified:
trunk/mcs/tests/ChangeLog
Log:
* gtest-212.cs, gtest-213.cs: New tests based on #76084.
Merging r51512 fixed these bugs.
Modified: trunk/mcs/tests/ChangeLog
===================================================================
--- trunk/mcs/tests/ChangeLog 2005-10-11 12:42:26 UTC (rev 51561)
+++ trunk/mcs/tests/ChangeLog 2005-10-11 12:43:07 UTC (rev 51562)
@@ -1,3 +1,7 @@
+2005-10-11 Raja R Harinath <[EMAIL PROTECTED]>
+
+ * gtest-212.cs, gtest-213.cs: New tests based on #76084.
+
2005-10-11 Marek Safar <[EMAIL PROTECTED]>
* test-461.cs: New test for #76370.
Added: trunk/mcs/tests/gtest-212.cs
===================================================================
--- trunk/mcs/tests/gtest-212.cs 2005-10-11 12:42:26 UTC (rev 51561)
+++ trunk/mcs/tests/gtest-212.cs 2005-10-11 12:43:07 UTC (rev 51562)
@@ -0,0 +1,25 @@
+public interface SomeInterface
+{
+ bool Valid { get; }
+}
+
+public struct SomeStruct : SomeInterface
+{
+ public bool Valid {
+ get {
+ return false;
+ }
+ }
+}
+
+public class Test
+{
+ public static void Fun<T>(T t) where T:SomeInterface {
+ bool a = t.Valid;
+ }
+
+ static void Main()
+ {
+ Fun(new SomeStruct());
+ }
+}
Added: trunk/mcs/tests/gtest-213.cs
===================================================================
--- trunk/mcs/tests/gtest-213.cs 2005-10-11 12:42:26 UTC (rev 51561)
+++ trunk/mcs/tests/gtest-213.cs 2005-10-11 12:43:07 UTC (rev 51562)
@@ -0,0 +1,30 @@
+public interface SomeInterface
+{
+ int Foo { get; set; }
+}
+
+public struct SomeStruct : SomeInterface
+{
+ int x;
+ public int Foo {
+ get { return x; }
+ set { x = value; }
+ }
+}
+
+public class Test
+{
+ public static void Fun<T> (T t)
+ where T : SomeInterface
+ {
+ if (++t.Foo != 1)
+ throw new System.Exception ("not 1");
+ if (t.Foo != 1)
+ throw new System.Exception ("didn't update 't'");
+ }
+
+ static void Main()
+ {
+ Fun (new SomeStruct ());
+ }
+}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches