internal void ChangeRefsToDefs(ClassDef newType, ClassDef[] oldTypes)
{
for (int i=0; i < oldTypes.Length; i++) {
if (retType == oldTypes[i]) retType = newType;
for (int j=0; j < numPars; j++) {
if (parTypes[j] == oldTypes[i])
parTypes[j] = newType;
}
for (int j=0; j < numOptPars; j++) {
if (optParTypes[j] == oldTypes[i])
optParTypes[j] = newType;
}
}
}