assert (referencedFrom != null);
assert (binding != null);
if (binding instanceof SourceTypeBinding) {
SourceTypeBinding type = (SourceTypeBinding) binding;
CompilationUnitScope from = findUnitScope(referencedFrom);
onTypeRef(type, from.referenceContext);
} else if (binding instanceof ArrayBinding) {
maybeDispatch(referencedFrom, expression,
((ArrayBinding) binding).leafComponentType);
} else if (binding instanceof BinaryTypeBinding) {
CompilationUnitScope from = findUnitScope(referencedFrom);
onBinaryTypeRef((BinaryTypeBinding) binding, from.referenceContext,
expression);
} else if (binding instanceof ParameterizedTypeBinding) {
// Make sure that we depend on the generic version of the class.
ParameterizedTypeBinding ptBinding = (ParameterizedTypeBinding) binding;