spec clarification: type annotations on static nested types

Alex Buckley alex.buckley at oracle.com
Tue Dec 11 20:03:41 UTC 2018


On 12/10/2018 6:14 PM, Liam Miller-Cushon wrote:
> On Mon, Dec 10, 2018 at 2:57 PM Alex Buckley <alex.buckley at oracle.com
> <mailto:alex.buckley at oracle.com>> wrote:
>
>     To avoid confusion, the rule should be: "If the value of path_length is
>     0, and the type being annotated is a nested type, then the annotation
>     applies to the outermost [DELETE]enclosing[/DELETE] part of the type
>     for which a type annotation is admissible."
...
>
> Does "outermost part of a type" refer to the idea of enclosing/nested
> types in general, or just in this specific context since we're only
> talking about nested types? Put another way, is it meaningful to talk
> about the 'outermost part' of arbitrary types?

Words based on "inner" and "outer" connect most strongly with nested 
types, where the containment relation is clear from the declaration 
site. Still, I can imagine that "outermost part" could be ascribed 
meaning for a array type or a parameterized type, where the containment 
exists but is driven by the use site. For example, given a use of the 
type T[][], the outermost type is T[][] and the innermost type is T; 
given a use of the type A<B<C>>, the outermost type is A<..> and the 
innermost type is C. This would specify the meaning of a non-zero 
path_length more firmly than "... each entry in the path array 
represents an iterative, left-to-right step towards the precise location 
of the annotation in an array type, nested type, or parameterized type". 
Is that the direction you were heading in?

Alex


More information about the compiler-dev mailing list