2010-05-12 Marek Safar <marek.safar@gmail.com>
authorMarek Safar <marek.safar@gmail.com>
Wed, 12 May 2010 16:38:27 +0000 (16:38 -0000)
committerMarek Safar <marek.safar@gmail.com>
Wed, 12 May 2010 16:38:27 +0000 (16:38 -0000)
A fix for bug #604981
* generic.cs, decl.cs, anonymous.cs: Reset more type arguments
details for nested anonymous methods stories.

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

mcs/mcs/ChangeLog
mcs/mcs/anonymous.cs
mcs/mcs/decl.cs
mcs/mcs/generic.cs

index 076d9f0139ea2c638fdc90f7b9fa50b715896d0d..e97a49cd671cbcf28fbcd1c392d651bf1c6ff3ca 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-12  Marek Safar  <marek.safar@gmail.com>
+
+       A fix for bug #604981
+       * generic.cs, decl.cs, anonymous.cs: Reset more type arguments
+       details for nested anonymous methods stories.
+
 2010-05-11  Marek Safar  <marek.safar@gmail.com>
 
        A fix for bug #604735
index 816a1dcc45cee2b7608af8a9fcc21cb8c0393294..207391533510cc71349bc71d6262be4841118014 100644 (file)
@@ -295,7 +295,7 @@ namespace Mono.CSharp {
                        type_params = null;
                        spec.IsGeneric = false;
                        spec.DeclaringType = parentStorey.CurrentType;
-//                     MemberName.TypeArguments = null;
+                       MemberName.TypeArguments = null;
                }
 
                protected override bool DoResolveTypeParameters ()
@@ -635,7 +635,7 @@ namespace Mono.CSharp {
                        }
 
                        if (inner_access == null) {
-                               if (field.Parent.MemberName.IsGeneric) {
+                               if (field.Parent.IsGeneric) {
                                        var fs = MemberCache.GetMember (field.Parent.CurrentType, field.Spec);
                                        inner_access = new FieldExpr (fs, field.Location);
                                } else {
index cba83b950b9d5e66604335b5a4cd69ee7f06458e..5f04e33fab416635e4205d59006fb63a1877774c 100644 (file)
@@ -31,7 +31,7 @@ namespace Mono.CSharp {
        //
        public class MemberName {
                public readonly string Name;
-               public readonly TypeArguments TypeArguments;
+               public TypeArguments TypeArguments;
 
                public readonly MemberName Left;
                public readonly Location Location;
@@ -984,8 +984,7 @@ namespace Mono.CSharp {
 
                //
                // Return true when this member is a generic in C# terms
-               // therefore nested non-generic type of generic type will
-               // return false
+               // A nested non-generic type of generic type will return false
                //
                public bool IsGeneric {
                        get {
@@ -1039,6 +1038,10 @@ namespace Mono.CSharp {
                        var inflated = (MemberSpec) MemberwiseClone ();
                        inflated.declaringType = inflator.TypeInstance;
                        inflated.state |= StateFlags.PendingMetaInflate;
+#if DEBUG
+                       if (inflated.ID > 0)
+                               inflated.ID = -inflated.ID;
+#endif
                        return inflated;
                }
 
index 73665219415ffde7a909882219928fd9fbcc8ac8..883e6f3beb9a158409deee28ac19f0d267290553 100644 (file)
@@ -1071,7 +1071,7 @@ namespace Mono.CSharp {
                        }
 
                        // Inflate generic type
-                       if (ts.IsGeneric)
+                       if (ts.Arity > 0)
                                return InflateTypeParameters (ts);
 
                        return ts;