> On Dec 17, 2017, at 6:15 PM, David Holmes <[email protected]> wrote:
> 
>> I looked over 13.1, and think it does a fine job of allowing binaries to use 
>> the NestHost and NestMembers attributes without any changes (see items 9 and 
>> 10 in the second list).
> 
> I don't follow. Items 9 and 10 seem to pertain to the InnerClasses attribute. 
> NestHost and NestMembers can not, in general, be used to convey the 
> information required by items 9 and 10. The NestHost attribute need not refer 
> to the immediately enclosing class. The NestMembers attribute only appears in 
> the top-level NestHost class.

Yeah, you're right. This section is very hand-wavy, so I tend to give it some 
latitude to say things that aren't exactly right. And there's a difference 
between _allowing_ a reference to something and _requiring_ it. But we could 
probably do a better job here and require the references we expect to appear in 
NestHost/NestMembers.

9. Every nested class and nested interface must have a symbolic reference to 
its immediately enclosing class (§8.1.3) **and, if different, the top-level 
type that encloses the class or interface**.

10. Every class must contain symbolic references to all of its member types 
(§8.5), and to all local and anonymous classes that appear in its methods, 
constructors, static initializers, instance initializers, and field 
initializers.

Every interface must contain symbolic references to all of its member types 
(§9.5), and to all local and anonymous classes that appear in its default 
methods and field initializers.

**If the class or interface is a top-level type declaration, it must contain 
symbolic references to all other classes or interfaces declared in its body and 
nested within other type declarations.**

—Dan

Reply via email to