Common supertypes: unwrap captured type from DNN type during recursion control

This commit handles subtle situation when K1 represents flexible type
arguments as just T..T?, but K2 does it as T&Any..T?.
This can provoke a type like Captured(*)&Any..Captured(*)?,
and before this commit we couldn't find recursion inside Captured(*)&Any.
This could lead to explosions inside type system and inference errors

#KT-60581 Fixed
This commit is contained in:
Mikhail Glukhikh
2023-09-21 14:22:49 +02:00
committed by Space Team
parent 610a9d9c6a
commit aea7b8f00a
5 changed files with 4 additions and 92 deletions
File diff suppressed because one or more lines are too long
@@ -72,7 +72,5 @@ fun test() {
true -> Assertions.assertThat(listOf("foo")).isNotEmpty
else -> Assertions.assertThat("bar").isEqualTo("bar")
}
// TODO: FIR
// {AbstractAssert<*, out Any!>! & EnumerableAssert<*, {Comparable<*> & java.io.Serializable!}>!} with unfolded flexible nullability
<!DEBUG_INFO_EXPRESSION_TYPE("({AbstractAssert<*, out (Any..Any?)> & EnumerableAssert<*, out ({Comparable<*> & java.io.Serializable}..{Comparable<*>? & java.io.Serializable?})>}..{AbstractAssert<*, out (Any..Any?)>? & EnumerableAssert<*, out ({Comparable<*> & java.io.Serializable}..{Comparable<*>? & java.io.Serializable?})>?})")!>assertion<!>
}