summaryrefslogtreecommitdiff
path: root/tests/src/Loader/classloader/generics/GenericMethods/method007.cs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/Loader/classloader/generics/GenericMethods/method007.cs')
-rw-r--r--tests/src/Loader/classloader/generics/GenericMethods/method007.cs58
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/src/Loader/classloader/generics/GenericMethods/method007.cs b/tests/src/Loader/classloader/generics/GenericMethods/method007.cs
new file mode 100644
index 0000000000..ee6aed8a08
--- /dev/null
+++ b/tests/src/Loader/classloader/generics/GenericMethods/method007.cs
@@ -0,0 +1,58 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Threading;
+
+interface IFoo
+{
+ U Function<U>(U u);
+}
+
+class Foo : IFoo
+{
+ public U Function<U>(U u)
+ {
+ return u;
+ }
+
+}
+
+public class Test
+{
+ public static int counter = 0;
+ public static bool result = true;
+ public static void Eval(bool exp)
+ {
+ counter++;
+ if (!exp)
+ {
+ result = exp;
+ Console.WriteLine("Test Failed at location: " + counter);
+ }
+
+ }
+
+ public static int Main()
+ {
+ IFoo f = new Foo();
+
+ Eval(f.Function<int>(1).Equals(1));
+ Eval(f.Function<string>("string").Equals("string"));
+
+
+ if (result)
+ {
+ Console.WriteLine("Test Passed");
+ return 100;
+ }
+ else
+ {
+ Console.WriteLine("Test Failed");
+ return 1;
+ }
+
+ }
+}
+