Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2014-05-21 12:19:25 +0400
committerMarek Safar <marek.safar@gmail.com>2014-05-21 12:19:25 +0400
commit35a8179e1ddcfbed00d4c4694f013803b44b5afb (patch)
tree151dd96f25c878b4ede17b0acfc84a1863079ac5 /mcs/tests/gtest-610.cs
parentf304ca8be1b8bfcc34c069cb062c2b0a6ef5fd57 (diff)
[mcs] Explicit type parameter conversion to generic parameter
Diffstat (limited to 'mcs/tests/gtest-610.cs')
-rw-r--r--mcs/tests/gtest-610.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/mcs/tests/gtest-610.cs b/mcs/tests/gtest-610.cs
new file mode 100644
index 00000000000..5299a5705a3
--- /dev/null
+++ b/mcs/tests/gtest-610.cs
@@ -0,0 +1,35 @@
+using System;
+
+class G1<T1, T2>
+ where T1 : B
+ where T2 : T1
+{
+ public static T2 Test1 (B b)
+ {
+ return (T2)b;
+ }
+
+ public static T2 Test2 (A a)
+ {
+ return (T2)a;
+ }
+
+ public static T2 Test3 (dynamic a)
+ {
+ return (T2)a;
+ }
+}
+
+class B : A
+{
+}
+
+class A
+{
+ static void Main ()
+ {
+ G1<B, B>.Test1 (new B ());
+ G1<B, B>.Test2 (new B ());
+ G1<B, B>.Test3 (null);
+ }
+} \ No newline at end of file