FIR: don't create incorrect constraints in CallableReferenceResolution

#KT-50994 Fixed
Related to KT-49477
This commit is contained in:
Mikhail Glukhikh
2022-04-18 14:07:08 +03:00
committed by Space
parent bdf229bc5c
commit 0ecba0ad0b
12 changed files with 178 additions and 388 deletions
@@ -63,7 +63,10 @@ internal object CheckCallableReferenceExpectedType : CheckerStage() {
val position = SimpleConstraintSystemConstraintPosition //TODO
if (expectedType != null) {
if (expectedType != null && !resultingType.contains {
it is ConeTypeVariableType && it.lookupTag !in outerCsBuilder.currentStorage().allTypeVariables
}
) {
addSubtypeConstraint(resultingType, expectedType, position)
}