native
native copied to clipboard
Shadowing the type parameter in non-static nested classes
Say we have a nested class like:
public class A<T> {
public class B<T> {
// ...
}
}
As far as I know, we cannot use the type parameter T (outer) inside B because T (inner) shadows it. So we can safely ignore the outer T.
- [ ] TODO: verify the above.
However we generate the code for this wrong in the unnesting process:
class B<$T extends JObject, $T extends JObject> { /* ... */ }
We should only generate one of the type parameters, but also correctly differentiate between the two when inferring types.