Merge pull request #1360 from madewokherd/winuncpath
[mono.git] / mono / mini / generics.cs
index cdf7b36ef68c95829e188f9d135fde4a3fb1f720..f350710c76e1b04e60e407212595aa47fe84b08b 100644 (file)
@@ -913,6 +913,7 @@ class Tests
                }
        }
 
+       [Category ("GSHAREDVT")]
        static int test_0_synchronized_gshared () {
                var c = new SyncClass<string> ();
                if (c.getInstance () != typeof (string))
@@ -1088,6 +1089,36 @@ class Tests
         var s = f2 (f);
                return s == "A" ? 0 : 1;
        }
+
+    public interface ICovariant<out R>
+    {
+    }
+
+    // Deleting the `out` modifier from this line stop the problem
+    public interface IExtCovariant<out R> : ICovariant<R>
+    {
+    }
+
+    public class Sample<R> : ICovariant<R>
+    {
+    }
+
+    public interface IMyInterface
+    {
+    }
+
+       public static int test_0_variant_cast_cache () {
+               object covariant = new Sample<IMyInterface>();
+
+               var foo = (ICovariant<IMyInterface>)(covariant);
+
+               try {
+                       var extCovariant = (IExtCovariant<IMyInterface>)covariant;
+                       return 1;
+               } catch {
+                       return 0;
+               }
+       }
 }
 
 #if !MOBILE