Generics are complicated sometimes.
Just think of the following declaration instead of yours:
Would it be legal? - Sure, C is a subclass of A.
But now the concrete type of g is parametrized to C, not A or B.
So what would happen when this line is called?
Oops. The (concrete) method signature is "doE(C)". A "B" is-not a "C".
That is why the compiler won't let you call the method.
The problem is the declaration "? extends A". It is a lower bound for the variable, but not the object. The referenced object can be parametrized to anything else that is subtype. So the compiler can't allow you to call the object with any type at all.
As this can get confusing
you should avoid bounds with variables.