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>2013-01-30 20:50:49 +0400
committerMarek Safar <marek.safar@gmail.com>2013-01-30 20:50:49 +0400
commit8ae1e29a87ea434f2276c23c4b1f8c777f6b9bfd (patch)
treed50a848424c0b4f3c9b38cac2d2854df89e2e6ea /mcs/tests/gtest-577.cs
parent82bfae8a22686756e692dc97a0b7977a485ba01f (diff)
Member lookup on type parameters has different ambiguity rules. Fixes #9776
Diffstat (limited to 'mcs/tests/gtest-577.cs')
-rw-r--r--mcs/tests/gtest-577.cs38
1 files changed, 38 insertions, 0 deletions
diff --git a/mcs/tests/gtest-577.cs b/mcs/tests/gtest-577.cs
new file mode 100644
index 00000000000..786eead37ea
--- /dev/null
+++ b/mcs/tests/gtest-577.cs
@@ -0,0 +1,38 @@
+using System;
+
+static class Program
+{
+ public interface I1
+ {
+ string Id { get; }
+ }
+
+ public class BaseClass
+ {
+ public int Id {
+ get {
+ return 4;
+ }
+ }
+ }
+
+ public class Derived : BaseClass, I1
+ {
+ public new string Id {
+ get {
+ return "aa";
+ }
+ }
+ }
+
+ static void Generic<T> (T item) where T : BaseClass, I1
+ {
+ if (item.Id != 4)
+ throw new Exception ("Doom!");
+ }
+
+ static void Main ()
+ {
+ Generic (new Derived ());
+ }
+}