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>2010-09-20 19:08:46 +0400
committerMarek Safar <marek.safar@gmail.com>2010-09-20 19:10:43 +0400
commit8881d43ffd330b8323756a2e12f648761cde1d3f (patch)
treefed2d0f6a77ac1e713fa8a83b8ce4fe44069f58e /mcs/tests/dtest-030.cs
parentf965a1facf3c2d59660ebfab241738e7b54068e7 (diff)
Don't check inferred dynamic type arguments against best candidate constraints.
Diffstat (limited to 'mcs/tests/dtest-030.cs')
-rw-r--r--mcs/tests/dtest-030.cs40
1 files changed, 40 insertions, 0 deletions
diff --git a/mcs/tests/dtest-030.cs b/mcs/tests/dtest-030.cs
new file mode 100644
index 00000000000..979e71965c5
--- /dev/null
+++ b/mcs/tests/dtest-030.cs
@@ -0,0 +1,40 @@
+using System;
+
+class A<T>
+{
+}
+
+class B
+{
+ static void M1<T> (T t) where T : struct
+ {
+ }
+
+ static void M2<T, U> (T t, U u) where U : IEquatable<T>
+ {
+ }
+
+ static void M3<T, U> (T t, A<U> u) where U : IEquatable<T>
+ {
+ }
+
+ static void M4<T, U> (T t, IEquatable<U> u) where T : IEquatable<U>
+ {
+ }
+
+ public static void Main ()
+ {
+ dynamic d = 2;
+ M1 (d);
+
+ M2 (d, 6);
+ M2 (4, d);
+
+ M3 (d, new A<int> ());
+
+ M4 (d, 6);
+ // TODO: type inference
+ //M4 (4, d);
+ }
+}
+