Change 'hashCode' of 'TypeProjection'

according to bug when there was exception in
`hashCode` call when projection has some `SpecialType`
like `NO_EXPECTED_TYPE`
This commit is contained in:
Dmitry Savvinov
2019-07-04 17:35:37 +03:00
parent b103f42ca8
commit 6695ddd1d5
@@ -46,7 +46,11 @@ public abstract class TypeProjectionBase implements TypeProjection {
@Override
public int hashCode() {
int result = getProjectionKind().hashCode();
result = 31 * result + (isStarProjection() ? 17 : getType().hashCode());
if (TypeUtils.noExpectedType(getType())) {
result = 31 * result +19;
} else {
result = 31 * result + (isStarProjection() ? 17 : getType().hashCode());
}
return result;
}
}