Bug 320680 (MONO77929) - [GMCS] incorrect CS0122 - private fields in nested container is inaccessible from nested types
Summary: [GMCS] incorrect CS0122 - private fields in nested container is inaccessible ...
Status: RESOLVED FIXED
Alias: MONO77929
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Raja R Harinath
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-27 09:50 UTC by Atsushi Enomoto
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
proposed fix (570 bytes, patch)
2006-03-31 10:44 UTC, Thomas Wiest
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:53:12 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".