[Mono-bugs] [Bug 77963][Cri] Changed - [GMCS] NRE on class X : Y<X.Z> - derived class of a generic type whose generic argument is its nested child class

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Sep 1 23:20:35 EDT 2006

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by jan.oravec at 6com.sk.


--- shadow/77963	2006-09-01 20:20:18.000000000 -0400
+++ shadow/77963.tmp.1578	2006-09-01 23:20:35.000000000 -0400
@@ -134,6 +134,26 @@
 Fails again with:
 c.cs(12,27): error CS0426: The nested type `Baz' does not exist in the
 type `Bar<Q>'
 Compilation failed: 1 error(s), 0 warnings
+------- Additional Comments From jan.oravec at 6com.sk  2006-09-01 23:20 -------
+I think I have found where is the problem. We are resolving
+Foo<Bar<Q>.Baz> in the context of Bar`1[Q] instead of just Bar`1.
+If I understand it right, TypeExpression denotes Bar`1, while
+ConstructedType denotes Bar`1[Q]. The code was not passing TypeBuilder
+to the MemberLookup and then to the MemberLookup_FindMembers, thus
+weren't able to find Baz there.
+This is first time I were looking at the gmcs source. I do not know
+the terminology, etc., but I think that ResolveAsTypeTerminal was
+supposed to get the TypeExpression from the ConstructedType, which is
+called at ResolveNamespaceOrType. Thus I overloaded
+ResolveAsTypeTerminal in ConstructedType.
+Please see the attached patch. I am not sure if I am right, it may be
+horribly wrong :). I have tested it and it appears to work and produce
+correct code.

More information about the mono-bugs mailing list