You are right. This is a great example demonstrating multiple subtleties of the language.
A more pedantic analysis -
In expression `getFirst(items)`, the sub-expression `items` goes through capture conversion first; it's type is converted to `Iterable<X>` where X<:AccessWeirdness&Object. (JLS#5.1.10)
Capture conversion is applied on every expression before it's used in a parent expression. This is so that the compiler can remove wildcards and only deal with values in "concrete" types.
Then, type inference on `getFirst(Iterable<X>)` results in `T=X`. Therefore the method returns `X`.
Now, we need to know the members of type `X`. Per JLS#4.4, the members of type variable `X` are the members of its upper bound AccessWeirdness&Object, an intersection type.
Per JLS#4.9, the intersection type induces a "notional" class for the purpose of identifying members; the notional class has `AccessWeirdness` as the direct superclass.
Therefore type `X` does not contain member `name`.
One solution is to up-cast `X` to `AccessWeirdness` to access `name`
AccessWeirdness a = getFirst(items); // assign X to AccessWeirdness
Zhong Yu