TypeDeclaration inheritedFrom) {
JCExpression result;
if (inheritedFrom instanceof Class) {
result = naming.makeSuper();
} else if (inheritedFrom instanceof Interface) {
Interface iface = (Interface)inheritedFrom;
JCExpression qualifier = null;
if (needDollarThis(superOfQualifiedExpr.getScope())) {
qualifier = naming.makeQuotedThis();
if (iface.equals(typeFact().getIdentifiableDeclaration())) {
result = naming.makeQualifiedSuper(qualifier);
} else {
result = naming.makeCompanionAccessorCall(qualifier, iface);
}
} else {
if (iface.equals(typeFact().getIdentifiableDeclaration())) {
result = naming.makeQualifiedSuper(qualifier);
} else {
result = naming.makeCompanionFieldName(iface);
}
}