c# - What does Eric Lippert mean by "you need to know what the base class is to determine what the base class is"? -


i read interesting article eric lippert, top 10 worst c# features. near end states:

the rules resolving names after aforementioned colon not founded; can end in situations need know base class in order determine base class is.

by colon referring inheritance operator (e.g. dog : animal).

what situation eric referring to? can provide code sample?

this can happen in convoluted scenarios generics, inheritance, , nested classes:

class base<t> {     public class inner {} }  class derived : base<derived.inner2> {     public class inner2 : inner {} } 

result

  • to determine derived's base class, need bind derived.inner2.
  • to bind derived.inner2, need resolve inner symbol.
  • the inner symbol inherited containing scope's base class, need determine derived's base class again.

Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -