Author: martin
Date: 2005-04-29 01:55:41 -0400 (Fri, 29 Apr 2005)
New Revision: 43769

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/expression.cs
   trunk/mcs/gmcs/generic.cs
Log:
2005-04-29  Martin Baulig  <[EMAIL PROTECTED]>

        * generic.cs (TypeManager.HasConstructorConstraint): Removed.

        * expression.cs (New.DoResolve): Fix the CS0304 check.



Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-04-29 05:52:54 UTC (rev 43768)
+++ trunk/mcs/gmcs/ChangeLog    2005-04-29 05:55:41 UTC (rev 43769)
@@ -1,5 +1,11 @@
 2005-04-29  Martin Baulig  <[EMAIL PROTECTED]>
 
+       * generic.cs (TypeManager.HasConstructorConstraint): Removed.
+
+       * expression.cs (New.DoResolve): Fix the CS0304 check.
+
+2005-04-29  Martin Baulig  <[EMAIL PROTECTED]>
+
        * typemanager.cs (TypeManager.GetFullName): Updated to the new
        naming schema.
 

Modified: trunk/mcs/gmcs/expression.cs
===================================================================
--- trunk/mcs/gmcs/expression.cs        2005-04-29 05:52:54 UTC (rev 43768)
+++ trunk/mcs/gmcs/expression.cs        2005-04-29 05:55:41 UTC (rev 43769)
@@ -5975,7 +5975,9 @@
                        }
 
                        if (type.IsGenericParameter) {
-                               if (!TypeManager.HasConstructorConstraint 
(type)) {
+                               GenericConstraints gc = 
TypeManager.GetTypeParameterConstraints (type);
+
+                               if ((gc == null) || 
(!gc.HasConstructorConstraint && !gc.IsValueType)) {
                                        Error (304, String.Format (
                                                       "Cannot create an 
instance of the " +
                                                       "variable type '{0}' 
because it " +

Modified: trunk/mcs/gmcs/generic.cs
===================================================================
--- trunk/mcs/gmcs/generic.cs   2005-04-29 05:52:54 UTC (rev 43768)
+++ trunk/mcs/gmcs/generic.cs   2005-04-29 05:55:41 UTC (rev 43769)
@@ -1631,15 +1631,6 @@
                        return (TypeParameter) builder_to_type_param [t];
                }
 
-               public static bool HasConstructorConstraint (Type t)
-               {
-                       GenericConstraints gc = GetTypeParameterConstraints (t);
-                       if (gc == null)
-                               return false;
-
-                       return (gc.Attributes & 
GenericParameterAttributes.DefaultConstructorConstraint) != 0;
-               }
-
                public static GenericConstraints GetTypeParameterConstraints 
(Type t)
                {
                        if (!t.IsGenericParameter)

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to