2006-10-09 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Mon, 9 Oct 2006 14:02:14 +0000 (14:02 -0000)
committerMartin Baulig <martin@novell.com>
Mon, 9 Oct 2006 14:02:14 +0000 (14:02 -0000)
* delegate.cs
(Delegate.DefineType): Don't call TypeParameter.Resolve() here;
moved that into Define() and also do the other type parameter
checks there.  Fixes #79094.  Added gtest-292.cs.

* expression.cs
(ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
since that doesn't include type parameters; don't use `Ldelema'
for type parameters.  Fixes #78980.  Added gtest-293.cs.

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

mcs/mcs/ChangeLog
mcs/mcs/delegate.cs
mcs/mcs/expression.cs

index d422a7ce1e26abb6664320394e3f54034e7dfd35..76aeefa71d3477443b85357d3db45e1716f014f6 100644 (file)
@@ -1,3 +1,15 @@
+2006-10-09  Martin Baulig  <martin@ximian.com>
+
+       * delegate.cs
+       (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
+       moved that into Define() and also do the other type parameter
+       checks there.  Fixes #79094.  Added gtest-292.cs.
+
+       * expression.cs
+       (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
+       since that doesn't include type parameters; don't use `Ldelema'
+       for type parameters.  Fixes #78980.  Added gtest-293.cs.
+
 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
 
        A fix for #77796
index 56f3b8f973e89481e5c93d604d7c76d6e6d07b1b..bd6f03e290100cf97e4734a840a19943cff89e30 100644 (file)
@@ -78,14 +78,6 @@ namespace Mono.CSharp {
                        if (TypeBuilder != null)
                                return TypeBuilder;
 
-#if GMCS_SOURCE
-                       if (IsGeneric) {
-                               foreach (TypeParameter type_param in TypeParameters)
-                                       if (!type_param.Resolve (this))
-                                               return null;
-                       }
-#endif
-                       
                        if (TypeManager.multicast_delegate_type == null && !RootContext.StdLib) {
                                Namespace system = RootNamespace.Global.GetNamespace ("System", true);
                                TypeExpr expr = system.Lookup (this, "MulticastDelegate", Location) as TypeExpr;
@@ -151,8 +143,20 @@ namespace Mono.CSharp {
                {
 #if GMCS_SOURCE
                        if (IsGeneric) {
-                               foreach (TypeParameter type_param in TypeParameters)
-                                       type_param.DefineType (this);
+                               foreach (TypeParameter type_param in TypeParameters) {
+                                       if (!type_param.Resolve (this))
+                                               return false;
+                               }
+
+                               foreach (TypeParameter type_param in TypeParameters) {
+                                       if (!type_param.DefineType (this))
+                                               return false;
+                               }
+
+                               foreach (TypeParameter type_param in TypeParameters) {
+                                       if (!type_param.CheckDependencies ())
+                                               return false;
+                               }
                        }
 #endif
 
index 06bac3ef51f630808e5b9f251e1a2baa780dfb6b..890ff63fcbc6ad77bfdc73f422f2fad496ee8755 100644 (file)
@@ -6449,10 +6449,9 @@ namespace Mono.CSharp {
                                        // If we are dealing with a struct, get the
                                        // address of it, so we can store it.
                                        //
-                                       if ((dims == 1) && 
-                                               TypeManager.IsValueType (etype) &&
-                                               (!TypeManager.IsBuiltinOrEnum (etype) ||
-                                               etype == TypeManager.decimal_type)) {
+                                       if ((dims == 1) && etype.IsValueType &&
+                                           (!TypeManager.IsBuiltinOrEnum (etype) ||
+                                            etype == TypeManager.decimal_type)) {
                                                if (e is New){
                                                        New n = (New) e;