2009-03-26 Marek Safar <marek.safar@gmail.com>
authorMarek Safar <marek.safar@gmail.com>
Thu, 26 Mar 2009 17:20:40 +0000 (17:20 -0000)
committerMarek Safar <marek.safar@gmail.com>
Thu, 26 Mar 2009 17:20:40 +0000 (17:20 -0000)
* generic.cs, support.cs: Moved generics stuff out of support.cs

svn path=/trunk/mcs/; revision=130316

mcs/mcs/ChangeLog
mcs/mcs/generic.cs
mcs/mcs/support.cs

index 6324e28ec8cefaa0c7de622ea69f23f1501dfb25..36244c6983e69c0bca200a81db8832b71d502075 100644 (file)
@@ -1,3 +1,7 @@
+2009-03-26  Marek Safar  <marek.safar@gmail.com>
+
+       * generic.cs, support.cs: Moved generics stuff out of support.cs
+
 2009-03-24  Marek Safar  <marek.safar@gmail.com>
 
        * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
index cbdb6575744141000a3d4564d6a7002116321881..bd13523c906a0bcdc2fe0ed96dc1f07f1806a6cf 100644 (file)
@@ -124,6 +124,69 @@ namespace Mono.CSharp {
                }
        }
 
+       public class ReflectionConstraints : GenericConstraints
+       {
+               GenericParameterAttributes attrs;
+               Type base_type;
+               Type class_constraint;
+               Type[] iface_constraints;
+               string name;
+
+               public static GenericConstraints GetConstraints (Type t)
+               {
+                       Type[] constraints = t.GetGenericParameterConstraints ();
+                       GenericParameterAttributes attrs = t.GenericParameterAttributes;
+                       if (constraints.Length == 0 && attrs == GenericParameterAttributes.None)
+                               return null;
+                       return new ReflectionConstraints (t.Name, constraints, attrs);
+               }
+
+               private ReflectionConstraints (string name, Type[] constraints, GenericParameterAttributes attrs)
+               {
+                       this.name = name;
+                       this.attrs = attrs;
+
+                       if ((constraints.Length > 0) && !constraints[0].IsInterface) {
+                               class_constraint = constraints[0];
+                               iface_constraints = new Type[constraints.Length - 1];
+                               Array.Copy (constraints, 1, iface_constraints, 0, constraints.Length - 1);
+                       } else
+                               iface_constraints = constraints;
+
+                       if (HasValueTypeConstraint)
+                               base_type = TypeManager.value_type;
+                       else if (class_constraint != null)
+                               base_type = class_constraint;
+                       else
+                               base_type = TypeManager.object_type;
+               }
+
+               public override string TypeParameter
+               {
+                       get { return name; }
+               }
+
+               public override GenericParameterAttributes Attributes
+               {
+                       get { return attrs; }
+               }
+
+               public override Type ClassConstraint
+               {
+                       get { return class_constraint; }
+               }
+
+               public override Type EffectiveBaseClass
+               {
+                       get { return base_type; }
+               }
+
+               public override Type[] InterfaceConstraints
+               {
+                       get { return iface_constraints; }
+               }
+       }
+
        public enum Variance
        {
                None,
index 30931150f72dab481b427b61953da83bcbf7b1f8..5a226ddde3662c7ea7b2e1252ad3af0f4fa310e3 100644 (file)
@@ -19,66 +19,6 @@ using System.Globalization;
 
 namespace Mono.CSharp {
 
-#if GMCS_SOURCE
-       public class ReflectionConstraints : GenericConstraints
-       {
-               GenericParameterAttributes attrs;
-               Type base_type;
-               Type class_constraint;
-               Type[] iface_constraints;
-               string name;
-
-               public static GenericConstraints GetConstraints (Type t)
-               {
-                       Type [] constraints = t.GetGenericParameterConstraints ();
-                       GenericParameterAttributes attrs = t.GenericParameterAttributes;
-                       if (constraints.Length == 0 && attrs == GenericParameterAttributes.None)
-                               return null;
-                       return new ReflectionConstraints (t.Name, constraints, attrs);
-               }
-
-               private ReflectionConstraints (string name, Type [] constraints, GenericParameterAttributes attrs)
-               {
-                       this.name = name;
-                       this.attrs = attrs;
-
-                       if ((constraints.Length > 0) && !constraints [0].IsInterface) {
-                               class_constraint = constraints [0];
-                               iface_constraints = new Type [constraints.Length - 1];
-                               Array.Copy (constraints, 1, iface_constraints, 0, constraints.Length - 1);
-                       } else
-                               iface_constraints = constraints;
-
-                       if (HasValueTypeConstraint)
-                               base_type = TypeManager.value_type;
-                       else if (class_constraint != null)
-                               base_type = class_constraint;
-                       else
-                               base_type = TypeManager.object_type;
-               }
-
-               public override string TypeParameter {
-                       get { return name; }
-               }
-
-               public override GenericParameterAttributes Attributes {
-                       get { return attrs; }
-               }
-
-               public override Type ClassConstraint {
-                       get { return class_constraint; }
-               }
-
-               public override Type EffectiveBaseClass {
-                       get { return base_type; }
-               }
-
-               public override Type[] InterfaceConstraints {
-                       get { return iface_constraints; }
-               }
-       }
-#endif
-
        class PtrHashtable : Hashtable {
                sealed class PtrComparer : IComparer
 #if NET_2_0