[loader] Init MonoClass:sizes.element_size lazily (Fixes #43563) (#5559)
[mono.git] / mono / tests / remoting4.cs
index cdb93be4d2f425c4125d94579336641ab270ccde..e26edf524907691c5e61b8599ef67fcaa0786905 100644 (file)
@@ -100,11 +100,19 @@ namespace RemotingTest
                }
        }
 
-       class R1 : MarshalByRefObject 
+       interface GenericIFace {
+               T Foo <T> ();
+       }
+
+       class R1 : MarshalByRefObject, GenericIFace
        {
                public R2 TestMBV() {
                        return new R2();
                }
+
+               public T Foo <T> () {
+                       return default (T);
+               }
        }
 
        class Class1
@@ -152,7 +160,25 @@ namespace RemotingTest
 
                        if (!bSerExc)
                                return 4;
+
+                       // Test generic virtual interface methods on proxies
+
+                       o = app2.CreateInstance(typeof(R1).Assembly.FullName, typeof(R1).FullName);
+                       myobj = (R1) o.Unwrap();
+
+                       GenericIFace iface = (GenericIFace)myobj;
+                       if (iface.Foo <int> () != 0)
+                               return 5;
+                       if (iface.Foo <string> () != null)
+                               return 6;
+
+                       // Test type identity (#504886, comment #10 ff.)
+
+                       if (typeof (R1) != myobj.GetType ())
+                               return 7;
        
+                       AppDomain.Unload (app2);
+
                        Console.WriteLine("test-ok");
                        return 0;
                }