Class Overrides.ExplicitOverrides.TypeSubstVisitor

All Implemented Interfaces:
TypeVisitor<TypeMirror,Void>
Enclosing class:
Overrides.ExplicitOverrides

private class Overrides.ExplicitOverrides.TypeSubstVisitor extends SimpleTypeVisitor6<TypeMirror,Void>
Visitor that replaces type variables with their values in the types it sees. If we know that E is String, then we can return String for E, List<String> for List<E>, String[] for E[], etc. We don't have to cover all types here because (1) the type is going to end up being erased, and (2) wildcards can't appear in direct supertypes. So for example it is illegal to write class MyList implements List<? extends Number>. It's legal to write class MyList implements List<Set<? extends Number>> but that doesn't matter because the E of the List is going to be erased to raw Set.