K2: don't generate Java overridden synthetics for Kotlin get/sets

#KT-59038 Fixed
This commit is contained in:
Mikhail Glukhikh
2023-06-12 17:52:30 +02:00
committed by Space Team
parent 9e39b7ef87
commit d8a20f1975
23 changed files with 459 additions and 3 deletions
@@ -195,8 +195,13 @@ class JavaClassUseSiteMemberScope(
val candidateReturnType = candidate.returnTypeRef.toConeKotlinTypeProbablyFlexible(session, typeParameterStack)
candidateSymbol.takeIf {
// TODO: Decide something for the case when property type is not computed yet
expectedReturnType == null || AbstractTypeChecker.isSubtypeOf(session.typeContext, candidateReturnType, expectedReturnType)
when {
candidate.isJavaOrEnhancement ->
// TODO: Decide something for the case when property type is not computed yet
expectedReturnType == null ||
AbstractTypeChecker.isSubtypeOf(session.typeContext, candidateReturnType, expectedReturnType)
else -> false
}
}
}
}
@@ -215,7 +220,7 @@ class JavaClassUseSiteMemberScope(
candidate.valueParameters.single().returnTypeRef.toConeKotlinTypeProbablyFlexible(session, typeParameterStack)
candidateSymbol.takeIf {
AbstractTypeChecker.equalTypes(session.typeContext, parameterType, propertyType)
candidate.isJavaOrEnhancement && AbstractTypeChecker.equalTypes(session.typeContext, parameterType, propertyType)
}
}
}