Fix for KtLightParameter and KtLightParameterList equality
This commit is contained in:
committed by
Pavel Talanov
parent
f8f5494d79
commit
6953ae79e2
@@ -185,4 +185,15 @@ public class KtLightParameter extends LightParameter implements KtLightDeclarati
|
||||
public boolean equals(Object obj) {
|
||||
return obj instanceof PsiElement && isEquivalentTo((PsiElement) obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
KtParameter kotlinOrigin = getKotlinOrigin();
|
||||
if (kotlinOrigin != null) {
|
||||
return kotlinOrigin.hashCode();
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
@@ -45,4 +45,15 @@ class KtLightParameterList(
|
||||
visitor.visitParameterList(this)
|
||||
}
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
other as KtLightParameterList
|
||||
if (parent != other.parent) return false
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int = parent.hashCode()
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user