diff options
Diffstat (limited to 'tests/src/Loader/classloader/generics/GenericMethods/method001a.cs')
-rw-r--r-- | tests/src/Loader/classloader/generics/GenericMethods/method001a.cs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/src/Loader/classloader/generics/GenericMethods/method001a.cs b/tests/src/Loader/classloader/generics/GenericMethods/method001a.cs new file mode 100644 index 0000000000..2aa0bc6f49 --- /dev/null +++ b/tests/src/Loader/classloader/generics/GenericMethods/method001a.cs @@ -0,0 +1,51 @@ +// 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; + +public class Foo +{ + internal T Function<T>(T i) + { + return i; + } + +} + +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() + { + Foo 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; + } + + } +} |