Merge pull request #1052 from sethjackson/master
authorAlex Rønne Petersen <alex@lycus.org>
Fri, 23 May 2014 10:49:28 +0000 (12:49 +0200)
committerAlex Rønne Petersen <alex@lycus.org>
Fri, 23 May 2014 10:49:28 +0000 (12:49 +0200)
Don't define _XOPEN_SOURCE on OpenBSD.

mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization_test.dll.sources
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug11916Test.cs [new file with mode: 0644]
mcs/class/System/System.Net/WebProxy.cs
mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs
mcs/errors/cs0455-6.cs [new file with mode: 0644]
mcs/mcs/generic.cs
mcs/mcs/method.cs
mcs/tests/gtest-613.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_5.xml

index 8e713d78eb17b74b356b275963efe1fce6d35c9c..5808c10c4c56d94a9b2ede0e2a3d65c29227ac67 100755 (executable)
@@ -35,6 +35,7 @@ using System.Reflection;
 using System.Runtime.Serialization.Formatters.Binary;
 using System.Xml;
 using System.Xml.Schema;
+using System.Xml.Serialization;
 
 using QName = System.Xml.XmlQualifiedName;
 
@@ -451,11 +452,13 @@ namespace System.Runtime.Serialization
                {
                        Type rootType = type;
 
+                       if (IsAny())
+                               return;
+
                        if (root_name.Value == "")
                                throw new InvalidDataContractException ("Type '" + type.ToString () +
                                        "' cannot have a DataContract attribute Name set to null or empty string.");
 
-
                        if (graph == null) {
                                if (names_filled)
                                        writer.WriteStartElement (root_name.Value, root_ns.Value);
@@ -544,6 +547,9 @@ namespace System.Runtime.Serialization
 
                public override void WriteEndObject (XmlDictionaryWriter writer)
                {
+                       if (IsAny())
+                               return;
+
                        writer.WriteEndElement ();
                }
 
@@ -559,5 +565,10 @@ namespace System.Runtime.Serialization
                        get { throw new NotImplementedException (); }
                }
 #endif
+
+               private bool IsAny() {
+                       var xpa = type.GetCustomAttribute<XmlSchemaProviderAttribute> (true);
+                       return xpa.IsAny;
+               }
        }
 }
index 342c949165816dc4d4106895554516f4d5a60ea3..448ad85b32e790964e536cfc48b3989be6bd9a37 100644 (file)
@@ -1,3 +1,4 @@
+System.Runtime.Serialization/Bug11916Test.cs
 System.Runtime.Serialization/Bug666333Test.cs
 System.Runtime.Serialization/Bug675144Test.cs
 System.Runtime.Serialization/Bug2843Test.cs
diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug11916Test.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug11916Test.cs
new file mode 100644 (file)
index 0000000..3a56cbb
--- /dev/null
@@ -0,0 +1,60 @@
+using System;
+using System.IO;
+using System.Runtime.Serialization;
+using System.Xml;
+using System.Xml.Schema;
+using System.Xml.Serialization;
+using System.Text;
+
+using NUnit.Framework;
+
+namespace MonoTests.System.Runtime.Serialization
+{
+
+    [XmlSchemaProvider(null, IsAny = true)]
+    public class TestElement : IXmlSerializable
+    {
+        public string Value { get; set; }
+
+        void IXmlSerializable.WriteXml(XmlWriter writer)
+        {
+            writer.WriteElementString("dummy", Value);
+        }
+
+        void IXmlSerializable.ReadXml(XmlReader reader)
+        {
+            Value = reader.ReadElementString("dummy");
+        }
+
+        XmlSchema IXmlSerializable.GetSchema()
+        {
+            return null;
+        }
+    }
+
+
+    [TestFixture]
+    public class Bug11916Test
+    {
+        [Test]
+        public void TestIsAnyTrueDataContractSerializer()
+        {
+            TestElement element = new TestElement();
+            element.Value = "bar";
+
+            StringBuilder stringBuilder = new StringBuilder ();
+
+            DataContractSerializer ser = new DataContractSerializer (typeof (TestElement));
+
+            using (var xw = XmlDictionaryWriter.CreateDictionaryWriter (XmlWriter.Create (new StringWriter (stringBuilder))))
+            {
+                ser.WriteObject(xw, element);
+            }
+
+            string actualXml   = stringBuilder.ToString ();
+            string expectedXml = "<?xml version=\"1.0\" encoding=\"utf-16\"?><dummy>bar</dummy>";
+
+            Assert.AreEqual (expectedXml, actualXml, "#1 IsAny=true DataContractSerializer");
+        }
+    }
+}
index 365535a056bb4b561f1eb55aef21e100c4da2305..0faf600c687039ab9d89922f14fcb7fa31b28f4a 100644 (file)
@@ -172,7 +172,7 @@ namespace System.Net
                                return true;
 
                        // LAMESPEC
-                       if (!bypassOnLocal) {
+                       if (bypassOnLocal) {
                                if (String.Compare (server, "localhost", true, CultureInfo.InvariantCulture) == 0)
                                        return true;
                                if (String.Compare (server, "loopback", true, CultureInfo.InvariantCulture) == 0)
index a596913e99282bfc1ad4208418037ba25d1bcb64..e193a5f53072d43025d0810d6e144911c15b4773 100644 (file)
@@ -40,7 +40,7 @@ namespace MonoTests.System.Net.WebSockets
                        }
                        if (socket != null) {
                                if (socket.State == WebSocketState.Open)
-                                       socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait ();
+                                       socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (2000);
                                socket.Dispose ();
                                socket = null;
                        }
@@ -51,7 +51,7 @@ namespace MonoTests.System.Net.WebSockets
                {
                        HandleHttpRequestAsync ((req, resp) => resp.StatusCode = 418);
                        try {
-                               socket.ConnectAsync (new Uri ("ws://localhost:" + Port), CancellationToken.None).Wait ();
+                               Assert.IsTrue (socket.ConnectAsync (new Uri ("ws://localhost:" + Port), CancellationToken.None).Wait (5000));
                        } catch (AggregateException e) {
                                AssertWebSocketException (e, WebSocketError.Success, typeof (WebException));
                                return;
@@ -67,7 +67,7 @@ namespace MonoTests.System.Net.WebSockets
                                        resp.Headers["Upgrade"] = "gtfo";
                                });
                        try {
-                               socket.ConnectAsync (new Uri ("ws://localhost:" + Port), CancellationToken.None).Wait ();
+                               Assert.IsTrue (socket.ConnectAsync (new Uri ("ws://localhost:" + Port), CancellationToken.None).Wait (5000));
                        } catch (AggregateException e) {
                                AssertWebSocketException (e, WebSocketError.Success);
                                return;
@@ -85,7 +85,7 @@ namespace MonoTests.System.Net.WebSockets
                                        //ForceSetHeader (resp.Headers, "Connection", "Foo");
                                });
                        try {
-                               socket.ConnectAsync (new Uri ("ws://localhost:" + Port), CancellationToken.None).Wait ();
+                               Assert.IsTrue (socket.ConnectAsync (new Uri ("ws://localhost:" + Port), CancellationToken.None).Wait (5000));
                        } catch (AggregateException e) {
                                AssertWebSocketException (e, WebSocketError.Success);
                                return;
@@ -103,7 +103,7 @@ namespace MonoTests.System.Net.WebSockets
                        Assert.AreEqual (WebSocketState.Open, socket.State);
 
                        var sendBuffer = Encoding.ASCII.GetBytes (Payload);
-                       socket.SendAsync (new ArraySegment<byte> (sendBuffer), WebSocketMessageType.Text, true, CancellationToken.None).Wait ();
+                       Assert.IsTrue (socket.SendAsync (new ArraySegment<byte> (sendBuffer), WebSocketMessageType.Text, true, CancellationToken.None).Wait (5000));
 
                        var receiveBuffer = new byte[Payload.Length];
                        var resp = socket.ReceiveAsync (new ArraySegment<byte> (receiveBuffer), CancellationToken.None).Result;
@@ -113,17 +113,17 @@ namespace MonoTests.System.Net.WebSockets
                        Assert.AreEqual (WebSocketMessageType.Text, resp.MessageType);
                        Assert.AreEqual (Payload, Encoding.ASCII.GetString (receiveBuffer, 0, resp.Count));
 
-                       socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait ();
+                       Assert.IsTrue (socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (5000));
                        Assert.AreEqual (WebSocketState.Closed, socket.State);
                }
 
                [Test]
                public void CloseOutputAsyncTest ()
                {
-                       socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait ();
+                       Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
                        Assert.AreEqual (WebSocketState.Open, socket.State);
 
-                       socket.CloseOutputAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait ();
+                       Assert.IsTrue (socket.CloseOutputAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (5000));
                        Assert.AreEqual (WebSocketState.CloseSent, socket.State);
 
                        var resp = socket.ReceiveAsync (new ArraySegment<byte> (new byte[0]), CancellationToken.None).Result;
@@ -136,10 +136,10 @@ namespace MonoTests.System.Net.WebSockets
                [Test]
                public void CloseAsyncTest ()
                {
-                       socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait ();
+                       Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
                        Assert.AreEqual (WebSocketState.Open, socket.State);
 
-                       socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait ();
+                       Assert.IsTrue (socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (5000));
                        Assert.AreEqual (WebSocketState.Closed, socket.State);
                }
 
@@ -152,7 +152,7 @@ namespace MonoTests.System.Net.WebSockets
                [Test, ExpectedException (typeof (ArgumentNullException))]
                public void SendAsyncArgTest_NoArray ()
                {
-                       socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait ();
+                       Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
                        socket.SendAsync (new ArraySegment<byte> (), WebSocketMessageType.Text, true, CancellationToken.None);
                }
 
@@ -165,7 +165,7 @@ namespace MonoTests.System.Net.WebSockets
                [Test, ExpectedException (typeof (ArgumentNullException))]
                public void ReceiveAsyncArgTest_NoArray ()
                {
-                       socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait ();
+                       Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
                        socket.ReceiveAsync (new ArraySegment<byte> (), CancellationToken.None);
                }
 
@@ -173,9 +173,9 @@ namespace MonoTests.System.Net.WebSockets
                public void ReceiveAsyncWrongState_Closed ()
                {
                        try {
-                               socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait ();
-                               socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait ();
-                               socket.ReceiveAsync (new ArraySegment<byte> (new byte[0]), CancellationToken.None).Wait ();
+                               Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
+                               Assert.IsTrue (socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (5000));
+                               Assert.IsTrue (socket.ReceiveAsync (new ArraySegment<byte> (new byte[0]), CancellationToken.None).Wait (5000));
                        } catch (AggregateException e) {
                                AssertWebSocketException (e, WebSocketError.Success);
                                return;
@@ -187,9 +187,9 @@ namespace MonoTests.System.Net.WebSockets
                public void SendAsyncWrongState_Closed ()
                {
                        try {
-                               socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait ();
-                               socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait ();
-                               socket.SendAsync (new ArraySegment<byte> (new byte[0]), WebSocketMessageType.Text, true, CancellationToken.None).Wait ();
+                               Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
+                               Assert.IsTrue (socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (5000));
+                               Assert.IsTrue (socket.SendAsync (new ArraySegment<byte> (new byte[0]), WebSocketMessageType.Text, true, CancellationToken.None).Wait (5000));
                        } catch (AggregateException e) {
                                AssertWebSocketException (e, WebSocketError.Success);
                                return;
@@ -201,9 +201,9 @@ namespace MonoTests.System.Net.WebSockets
                public void SendAsyncWrongState_CloseSent ()
                {
                        try {
-                               socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait ();
-                               socket.CloseOutputAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait ();
-                               socket.SendAsync (new ArraySegment<byte> (new byte[0]), WebSocketMessageType.Text, true, CancellationToken.None).Wait ();
+                               Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
+                               Assert.IsTrue (socket.CloseOutputAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (5000));
+                               Assert.IsTrue (socket.SendAsync (new ArraySegment<byte> (new byte[0]), WebSocketMessageType.Text, true, CancellationToken.None).Wait (5000));
                        } catch (AggregateException e) {
                                AssertWebSocketException (e, WebSocketError.Success);
                                return;
diff --git a/mcs/errors/cs0455-6.cs b/mcs/errors/cs0455-6.cs
new file mode 100644 (file)
index 0000000..62b9bd3
--- /dev/null
@@ -0,0 +1,18 @@
+// CS0455: Type parameter `T3' inherits conflicting constraints `X' and `Y'
+// Line: 15
+
+class X
+{
+}
+
+class Y
+{
+}
+
+class C<T1, T2, T3, T4>
+       where T1 : X
+       where T2 : T1
+       where T3 : Y, T4
+       where T4 : T2
+{
+}
\ No newline at end of file
index 93eba5552944c163dd97552794eacdc2895e4e3a..89fd1a2e6ac9c7799a7b28e27fb854761fcb7a92 100644 (file)
@@ -262,8 +262,7 @@ namespace Mono.CSharp {
                                        iface_found = true;
                                        continue;
                                }
-
-
+                                       
                                var constraint_tp = type as TypeParameterSpec;
                                if (constraint_tp != null) {
                                        if (tparam_types == null) {
@@ -314,6 +313,12 @@ namespace Mono.CSharp {
                                                }
                                        }
 
+                                       if (constraint_tp.TypeArguments != null) {
+                                               var eb = constraint_tp.GetEffectiveBase ();
+                                               if (eb != null && !CheckConflictingInheritedConstraint (spec, eb, spec.BaseType, context, constraint.Location))
+                                                       break;
+                                       }
+
                                        if (constraint_tp.HasSpecialStruct) {
                                                context.Module.Compiler.Report.Error (456, constraint.Location,
                                                        "Type parameter `{0}' has the `struct' constraint, so it cannot be used as a constraint for `{1}'",
@@ -764,6 +769,7 @@ namespace Mono.CSharp {
                int tp_pos;
                TypeSpec[] targs;
                TypeSpec[] ifaces_defined;
+               TypeSpec effective_base;
 
                //
                // Creates type owned type parameter
@@ -1027,23 +1033,27 @@ namespace Mono.CSharp {
                                return BaseType.IsStruct ? BaseType.BaseType : BaseType;
                        }
 
-                       var types = targs;
-                       if (HasTypeConstraint) {
-                               Array.Resize (ref types, types.Length + 1);
+                       if (effective_base != null)
+                               return effective_base;
+
+                       var types = new TypeSpec [HasTypeConstraint ? targs.Length + 1 : targs.Length];
+
+                       for (int i = 0; i < targs.Length; ++i) {
+                               var t = targs [i];
 
-                               for (int i = 0; i < types.Length - 1; ++i) {
-                                       types[i] = types[i].BaseType;
+                               // Same issue as above, inherited constraints can be of struct type
+                               if (t.IsStruct) {
+                                       types [i] = t.BaseType;
+                                       continue;
                                }
 
-                               types[types.Length - 1] = BaseType;
-                       } else {
-                               types = types.Select (l => l.BaseType).ToArray ();
+                               types [i] = ((TypeParameterSpec)t).GetEffectiveBase ();
                        }
 
-                       if (types != null)
-                               return Convert.FindMostEncompassedType (types);
+                       if (HasTypeConstraint)
+                               types [types.Length - 1] = BaseType;
 
-                       return BaseType;
+                       return effective_base = Convert.FindMostEncompassedType (types);
                }
 
                public override string GetSignatureForDocumentation ()
@@ -1307,12 +1317,17 @@ namespace Mono.CSharp {
 
                        if (targs != null) {
                                foreach (var ta in targs) {
-                                       var b_type = ta.BaseType;
-                                       if (b_type.BuiltinType != BuiltinTypeSpec.Type.Object && b_type.BuiltinType != BuiltinTypeSpec.Type.ValueType)
-                                               cache.AddBaseType (b_type);
-
                                        var tps = ta as TypeParameterSpec;
-                                       var ifaces = tps != null ? tps.InterfacesDefined : ta.Interfaces;
+                                       IList<TypeSpec> ifaces;
+                                       if (tps != null) {
+                                               var b_type = tps.GetEffectiveBase ();
+                                               if (b_type != null && b_type.BuiltinType != BuiltinTypeSpec.Type.Object && b_type.BuiltinType != BuiltinTypeSpec.Type.ValueType)
+                                                       cache.AddBaseType (b_type);
+
+                                               ifaces = tps.InterfacesDefined;
+                                       } else {
+                                               ifaces = ta.Interfaces;
+                                       }
 
                                        if (ifaces != null) {
                                                foreach (var iface_type in ifaces) {
index 0e8e85e2d6b8039826bacf70068a519cdfb6a791..58baf51b09e034d5429b6ab6f7f3f79cbf9fd96c 100644 (file)
@@ -1101,61 +1101,61 @@ namespace Mono.CSharp {
                        }
 
                        for (int i = 0; i < tparams.Count; ++i) {
-                               var tp = tparams[i];
+                               var tp = tparams [i];
 
-                               if (!tp.ResolveConstraints (this))
+                               if (base_tparams == null) {
+                                       tp.ResolveConstraints (this);
                                        continue;
+                               }
 
                                //
                                // Copy base constraints for override/explicit methods
                                //
-                               if (base_tparams != null) {
-                                       var base_tparam = base_tparams[i];
-                                       var local_tparam = tp.Type;
-                                       local_tparam.SpecialConstraint = base_tparam.SpecialConstraint;
-
-                                       var inflator = new TypeParameterInflator (this, CurrentType, base_decl_tparams, base_targs);
-                                       base_tparam.InflateConstraints (inflator, local_tparam);
+                               var base_tparam = base_tparams [i];
+                               var local_tparam = tp.Type;
+                               local_tparam.SpecialConstraint = base_tparam.SpecialConstraint;
 
-                                       //
-                                       // Check all type argument constraints for possible collision or unification
-                                       // introduced by inflating inherited constraints in this context
-                                       //
-                                       // Conflict example:
-                                       //
-                                       // class A<T> { virtual void Foo<U> () where U : class, T {} }
-                                       // class B : A<int> { override void Foo<U> {} }
-                                       //
-                                       var local_tparam_targs = local_tparam.TypeArguments;
-                                       if (local_tparam_targs != null) {
-                                               for (int ii = 0; ii < local_tparam_targs.Length; ++ii) {
-                                                       var ta = local_tparam_targs [ii];
-                                                       if (!ta.IsClass && !ta.IsStruct)
-                                                               continue;
-
-                                                       TypeSpec[] unique_tparams = null;
-                                                       for (int iii = ii + 1; iii < local_tparam_targs.Length; ++iii) {
-                                                               //
-                                                               // Remove any identical or unified constraint types
-                                                               //
-                                                               var tparam_checked = local_tparam_targs[iii];
-                                                               if (TypeSpecComparer.IsEqual (ta, tparam_checked) || TypeSpec.IsBaseClass (ta, tparam_checked, false)) {
-                                                                       unique_tparams = new TypeSpec[local_tparam_targs.Length - 1];
-                                                                       Array.Copy (local_tparam_targs, 0, unique_tparams, 0, iii);
-                                                                       Array.Copy (local_tparam_targs, iii + 1, unique_tparams, iii, local_tparam_targs.Length - iii - 1);
-                                                               } else if (!TypeSpec.IsBaseClass (tparam_checked, ta, false)) {
-                                                                       Constraints.Error_ConflictingConstraints (this, local_tparam, ta, tparam_checked, Location);
-                                                               }
-                                                       }
+                               var inflator = new TypeParameterInflator (this, CurrentType, base_decl_tparams, base_targs);
+                               base_tparam.InflateConstraints (inflator, local_tparam);
 
-                                                       if (unique_tparams != null) {
-                                                               local_tparam_targs = unique_tparams;
-                                                               local_tparam.TypeArguments = local_tparam_targs;
-                                                               continue;
+                               //
+                               // Check all type argument constraints for possible collision or unification
+                               // introduced by inflating inherited constraints in this context
+                               //
+                               // Conflict example:
+                               //
+                               // class A<T> { virtual void Foo<U> () where U : class, T {} }
+                               // class B : A<int> { override void Foo<U> {} }
+                               //
+                               var local_tparam_targs = local_tparam.TypeArguments;
+                               if (local_tparam_targs != null) {
+                                       for (int ii = 0; ii < local_tparam_targs.Length; ++ii) {
+                                               var ta = local_tparam_targs [ii];
+                                               if (!ta.IsClass && !ta.IsStruct)
+                                                       continue;
+
+                                               TypeSpec[] unique_tparams = null;
+                                               for (int iii = ii + 1; iii < local_tparam_targs.Length; ++iii) {
+                                                       //
+                                                       // Remove any identical or unified constraint types
+                                                       //
+                                                       var tparam_checked = local_tparam_targs [iii];
+                                                       if (TypeSpecComparer.IsEqual (ta, tparam_checked) || TypeSpec.IsBaseClass (ta, tparam_checked, false)) {
+                                                               unique_tparams = new TypeSpec[local_tparam_targs.Length - 1];
+                                                               Array.Copy (local_tparam_targs, 0, unique_tparams, 0, iii);
+                                                               Array.Copy (local_tparam_targs, iii + 1, unique_tparams, iii, local_tparam_targs.Length - iii - 1);
+                                                       } else if (!TypeSpec.IsBaseClass (tparam_checked, ta, false)) {
+                                                               Constraints.Error_ConflictingConstraints (this, local_tparam, ta, tparam_checked, Location);
                                                        }
+                                               }
 
-                                                       Constraints.CheckConflictingInheritedConstraint (local_tparam, ta, this, Location);
+                                               if (unique_tparams != null) {
+                                                       local_tparam_targs = unique_tparams;
+                                                       local_tparam.TypeArguments = local_tparam_targs;
+                                                       continue;
                                                }
+
+                                               Constraints.CheckConflictingInheritedConstraint (local_tparam, ta, this, Location);
                                        }
                                }
                        }
diff --git a/mcs/tests/gtest-613.cs b/mcs/tests/gtest-613.cs
new file mode 100644 (file)
index 0000000..963642b
--- /dev/null
@@ -0,0 +1,33 @@
+class X
+{
+       public static void Foo (X x1)
+       {
+       }
+
+       public static void Main ()
+       {
+               C<X, X, X>.Test (new X ());
+       }
+
+       public int Prop {
+               get {
+                       return 5;
+               }
+       }
+}
+
+class Y
+{
+}
+
+class C<T1, T2, T3>
+       where T1 : X
+       where T2 : T1
+       where T3 : T2
+{
+       public static void Test (T3 t3)
+       {
+               X.Foo (t3);
+               var g = t3.Prop;
+       }
+}
\ No newline at end of file
index 2502cf0aa7bdfc0e62ca69fe2d829704602cc353..19d9696f82c022aed828f8fb4e98ad92b6a9ab45 100644 (file)
       </method>\r
     </type>\r
   </test>\r
+  <test name="gtest-613.cs">\r
+    <type name="X">\r
+      <method name="Void Foo(X)" attrs="150">\r
+        <size>2</size>\r
+      </method>\r
+      <method name="Void Main()" attrs="150">\r
+        <size>12</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="Y">\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="C`3[T1,T2,T3]">\r
+      <method name="Void Test(T3)" attrs="150">\r
+        <size>27</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="X">\r
+      <method name="Int32 get_Prop()" attrs="2182">\r
+        <size>10</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
   <test name="gtest-anontype-01.cs">\r
     <type name="Test">\r
       <method name="Int32 Main()" attrs="150">\r