Fixed navigation to library sources when function has vararg parameter.

This commit is contained in:
Evgeny Gerashchenko
2012-05-21 16:41:46 +04:00
parent c57dbb3895
commit 640fca42a4
@@ -254,8 +254,15 @@ public class JetSourceNavigationHelper {
if (typeReference == null) {
return false;
}
JetModifierList modifierList = declarationParameter.getModifierList();
boolean vararg = modifierList != null && modifierList.hasModifier(JetTokens.VARARG_KEYWORD);
if (vararg != (descriptorParameter.getVarargElementType() != null)) {
return false;
}
String declarationTypeText = typeReference.getText();
String descriptorParameterText = DescriptorRenderer.TEXT.renderType(descriptorParameter.getType());
String descriptorParameterText = DescriptorRenderer.TEXT.renderType(vararg
? descriptorParameter.getVarargElementType()
: descriptorParameter.getType());
if (!declarationTypeText.equals(descriptorParameterText)) {
return false;
}