X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fgenerics.cs;h=f350710c76e1b04e60e407212595aa47fe84b08b;hb=100ecb4f0f7e901b593eaa35057a3f8aa2cdcaf7;hp=cdf7b36ef68c95829e188f9d135fde4a3fb1f720;hpb=2ab02d99c44321dfc73fd10bee7a6fbf7016116b;p=mono.git diff --git a/mono/mini/generics.cs b/mono/mini/generics.cs index cdf7b36ef68..f350710c76e 100644 --- a/mono/mini/generics.cs +++ b/mono/mini/generics.cs @@ -913,6 +913,7 @@ class Tests } } + [Category ("GSHAREDVT")] static int test_0_synchronized_gshared () { var c = new SyncClass (); if (c.getInstance () != typeof (string)) @@ -1088,6 +1089,36 @@ class Tests var s = f2 (f); return s == "A" ? 0 : 1; } + + public interface ICovariant + { + } + + // Deleting the `out` modifier from this line stop the problem + public interface IExtCovariant : ICovariant + { + } + + public class Sample : ICovariant + { + } + + public interface IMyInterface + { + } + + public static int test_0_variant_cast_cache () { + object covariant = new Sample(); + + var foo = (ICovariant)(covariant); + + try { + var extCovariant = (IExtCovariant)covariant; + return 1; + } catch { + return 0; + } + } } #if !MOBILE