/*
* For every instantiated array type that could -in theory- be the
* runtime type of the lhs, we must record a cast from the rhs to the
* prospective element type of the lhs.
*/
JTypeOracle typeOracle = program.typeOracle;
JType rhsType = x.getRhs().getType();
assert (rhsType instanceof JReferenceType);
JReferenceType refRhsType = (JReferenceType) rhsType;
for (Iterator it = instantiatedArrayTypes.iterator(); it.hasNext();) {
JArrayType arrayType = (JArrayType) it.next();
if (typeOracle.canTheoreticallyCast(arrayType, lhsArrayType)) {
JType itElementType = arrayType.getElementType();
if (itElementType instanceof JReferenceType) {
recordCastInternal((JReferenceType) itElementType, refRhsType);
}
}