Menu

keywords-inner

Will Pittenger

ASIL nested types come in two forms: normal and inner. If you just declare a nested type, it has access to public static members, public static methods, public static properties, and public nested types of the enclosing type only. Access to protected and private data members, methods, properties, or nested types isn't allowed. Instances of the nested type aren't associated with any instance of the enclosing type at all.

On the other hand, if you add the inner keyword to the declaration of the nested type, each instance of the nested type must be associated with an instance of the enclosing type. The closest equivalent would be non-static inner classes in Java. (Don't confuse Java's term "inner class" with the ASIL inner keyword.) inner nested types have access to all static data members, methods, properties, and nested types of the regardless of the access qualifier. Instances of inner nested types have access to all instance data members, methods, properties regardless of the access qualifier. Inner types can be static when required. That causes the type to have access to protected and private static data members, methods, properties, and nested types.

(\public\ | \protected\ | \private\) {[(\abstract\ | \final\)] | [\inner\] | [\const\] | [\static\]} (\class\ | \struct\) /identifier/
  ' Rest of type declaration

Related

Wiki: Keywords
Wiki: keywords-new