.net - C# allows reversed reference to nested class? -


is bug in microsoft c# compiler, or syntax serve purpose i'm not aware of?

class p1 {     class p2 : p1     {         class p3 : p2         {             void foo()             {                 p3 p3 = p2.p3;                 p2 p2 = p3.p2;  // ?!?             }         };     }; }; 

edit: should mention compiles fine in vs2010.

this works because nested classes inherit class they're nested in.

p3 p2, p1, has nested p2.


Comments

Popular posts from this blog

400 Bad Request on Apache/PHP AddHandler wrapper -

Add email recipient to all new Trac tickets -

php - Change action and image src url's with jQuery -