summaryrefslogtreecommitdiff
path: root/tests/src/Loader/lowlevel/regress/105736/exception.cs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/Loader/lowlevel/regress/105736/exception.cs')
-rw-r--r--tests/src/Loader/lowlevel/regress/105736/exception.cs63
1 files changed, 63 insertions, 0 deletions
diff --git a/tests/src/Loader/lowlevel/regress/105736/exception.cs b/tests/src/Loader/lowlevel/regress/105736/exception.cs
new file mode 100644
index 0000000000..27674f7cac
--- /dev/null
+++ b/tests/src/Loader/lowlevel/regress/105736/exception.cs
@@ -0,0 +1,63 @@
+
+using System;
+
+public struct GS1<T>
+{
+ public T t;
+ public GS1(T t)
+ {
+ this.t = t;
+ }
+}
+
+public abstract class Base
+{
+ public abstract T vMeth1<T>(T t) ;
+ public abstract T vMeth2<T>(out T t);
+}
+
+public class Sub : Base
+{
+ public override T vMeth1<T>(T t)
+ {
+ return t;
+ }
+
+ public override T vMeth2<T>(out T t)
+ {
+ t = default(T);
+ return t;
+ }
+}
+
+public class Test
+{
+ public static int Main()
+ {
+ try
+ {
+ GS1<string> TestValue = new GS1<string>("string");
+ Sub obj = new Sub();
+
+ obj.vMeth1<GS1<string>>(TestValue);
+ obj.vMeth2<GS1<string>>(out TestValue);
+ System.Console.WriteLine(TestValue.t);
+
+ // no exceptions caught
+ Console.WriteLine("PASS");
+ return 100;
+ }
+ catch (System.NotSupportedException ex)
+ {
+ Console.WriteLine("{0} \n Caught unexpected System.NotSupportedException exception.", ex);
+ Console.WriteLine("FAIL");
+ return 101;
+ }
+ catch (System.Exception ex)
+ {
+ Console.WriteLine("{0} \n Caught unexpected exception.", ex);
+ Console.WriteLine("FAIL");
+ return 101;
+ }
+ }
+} \ No newline at end of file