if (decl instanceof MethodOrValue
&& ((MethodOrValue)decl).isParameter()
&& decl.getContainer() instanceof Class) {
// Parameters in a refined class are not considered refinements themselves
// We have in find the refined attribute
Class c = (Class)decl.getContainer();
boolean isAlias = c.isAlias();
boolean isActual = c.isActual();
// aliases and actual classes actually do refine their extended type parameters so the same rules apply wrt
// boxing and stuff
if (isAlias || isActual) {
int index = c.getParameterList().getParameters().indexOf(findParamForDecl(((TypedDeclaration)decl)));
// ATM we only consider aliases if we're looking at aliases, and same for actual, not mixing the two.
// Note(Stef): not entirely sure about that one, what about aliases of actual classes?
while ((isAlias && c.isAlias())
|| (isActual && c.isActual())) {
c = c.getExtendedTypeDeclaration();
}
// be safe
if(c.getParameterList() == null
|| c.getParameterList().getParameters() == null
|| c.getParameterList().getParameters().size() <= index)
return null;
decl = c.getParameterList().getParameters().get(index).getModel();
}
if (decl.isShared()) {
Declaration refinedDecl = c.getRefinedMember(decl.getName(), getSignature(decl), false);//?? ellipsis=false??
if(refinedDecl != null && !Decl.equal(refinedDecl, decl)) {
return getTopmostRefinedDeclaration(refinedDecl, methodOverrides);
}
}
return decl;