2005-06-21 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Tue, 21 Jun 2005 09:47:02 +0000 (09:47 -0000)
committerMartin Baulig <martin@novell.com>
Tue, 21 Jun 2005 09:47:02 +0000 (09:47 -0000)
* expression.cs (MemberAccess.DoResolve): Add support for nested
types in a generic instance; fixes #75320.

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

mcs/gmcs/ChangeLog
mcs/gmcs/expression.cs

index bbb6d375e1808f8e676b710dde814176398d9375..0802963ed9e027b7446a9a75ae3c93f59e42e486 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-21  Martin Baulig  <martin@ximian.com>
+
+       * expression.cs (MemberAccess.DoResolve): Add support for nested
+       types in a generic instance; fixes #75320.
+
 2005-06-20  Martin Baulig  <martin@ximian.com>
 
        * generic.cs (TypeManager.InferType): Also walk the class
index 580f90dfa3e9e13eee0e41b0f019dc3640458431..3f486d392bf0f4cf91e9ce0dad49f71aca92d269 100644 (file)
@@ -7498,6 +7498,21 @@ namespace Mono.CSharp {
                                        return null;
                                }
 
+                               ConstructedType ct = expr as ConstructedType;
+                               if (ct != null) {
+                                       //
+                                       // When looking up a nested type in a generic instance
+                                       // via reflection, we always get a generic type definition
+                                       // and not a generic instance - so we have to do this here.
+                                       //
+                                       // See gtest-172-lib.cs and gtest-172.cs for an example.
+                                       //
+                                       ct = new ConstructedType (
+                                               member_lookup.Type, ct.TypeArguments, loc);
+
+                                       return ct.ResolveAsTypeStep (ec);
+                               }
+
                                return member_lookup;
                        }