Bugzilla – Bug 320680
[GMCS] incorrect CS0122 - private fields in nested container is inaccessible from nested types
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by atsushi@ximian.com 2006-03-27 02:50:49 MST ---- gmcs incorrectly treats 1)private fields in the 2)container 3)generic type as inaccessible from a nested class. class Test<T> { int priv; private sealed class Inner<U> { Test<U> test; void Foo () { test.priv = 0; } } } Actual Results: privaccess.cs(9,4): error CS0122: `Test<U>.priv' is inaccessible due to its protection level Expected Results: no CS0122. How often does this happen? consistently. ---- Additional Comments From atsushi@ximian.com 2006-03-30 15:56:44 MST ---- BTW it is the blocker for compiling kazuki's SortedDictionary.cs http://monkey.workarea.jp/tmp/200603/SortedDictionary.cs ---- Additional Comments From atsushi@ximian.com 2006-03-31 03:44:44 MST ---- Created an attachment (id=169495) proposed fix ---- Additional Comments From rharinath@novell.com 2006-04-01 11:07:43 MST ---- But, then your fix won't work for a third-level nested type. I'm working on an alternative fix. ---- Additional Comments From rharinath@novell.com 2006-04-01 11:18:36 MST ---- Should be fixed in SVN r58890. Imported an attachment (id=169495) Unknown operating system unknown. Setting to default OS "Other".