Setup partial type constraints types without expanding interface list
authorMarek Safar <marek.safar@gmail.com>
Fri, 5 Oct 2012 15:36:19 +0000 (16:36 +0100)
committerMarek Safar <marek.safar@gmail.com>
Fri, 5 Oct 2012 15:37:05 +0000 (16:37 +0100)
mcs/mcs/generic.cs
mcs/tests/gtest-partial-03.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_5.xml

index 01231ba093c35911238bfa4699100ecd8394f5d6..57c7ac96cd7bcb0d5395af27125bb06e19ce729c 100644 (file)
@@ -499,7 +499,7 @@ namespace Mono.CSharp {
 
                        // Copy constraint from resolved part to partial container
                        spec.SpecialConstraint = tp.spec.SpecialConstraint;
-                       spec.InterfacesDefined = tp.spec.InterfacesDefined;
+                       spec.Interfaces = tp.spec.Interfaces;
                        spec.TypeArguments = tp.spec.TypeArguments;
                        spec.BaseType = tp.spec.BaseType;
                        
diff --git a/mcs/tests/gtest-partial-03.cs b/mcs/tests/gtest-partial-03.cs
new file mode 100644 (file)
index 0000000..177fa48
--- /dev/null
@@ -0,0 +1,29 @@
+using System.Collections.Generic;
+
+class Variable
+{
+}
+
+internal partial class Test<T>
+{
+}
+
+internal partial class Test<T> where T : IList<Variable>
+{
+       public Test (T t)
+       {
+               var val = t.Count;
+       }
+}
+
+internal partial class Test<T>
+{
+}
+
+class CC
+{
+       public static void Main ()
+       {
+               new Test<List<Variable>> (new List<Variable> ());
+       }
+}
\ No newline at end of file
index 618c9880979f9272dc89fe54a060a18770189227..40aad99e35b5e62200226407f8e40af0d28fbed0 100644 (file)
       </method>\r
     </type>\r
   </test>\r
+  <test name="gtest-partial-03.cs">\r
+    <type name="Variable">\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="Test`1[T]">\r
+      <method name="Void .ctor(T)" attrs="6278">\r
+        <size>22</size>\r
+      </method>\r
+    </type>\r
+    <type name="CC">\r
+      <method name="Void Main()" attrs="150">\r
+        <size>13</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
   <test name="gtest-var-04.cs">\r
     <type name="Test">\r
       <method name="Int32 Main()" attrs="145">\r