[FIR] Only don't approximate nested captured arguments if they have recursive supertypes
This fixes a compiler crash IllegalStateException: Captured type for incorporation shouldn't escape from incorporation The crash occurs when a captured type with status FOR_INCORPORATION is two layers deep inside a captured type with status FROM_EXPRESSION. We first check if approximation is required for the most outer captured type in AbstractTypeApproximator.approximateCapturedType. Then we encounter the second captured type with status FROM_EXPRESSION in AbstractTypeApproximator.approximateParametrizedType. At this point, we stop checking and miss the third captured type with status FOR_INCORPORATION. Unfortunately, we can't check recursively if nested captured types need to be approximated because of types with recursive super types (the original reason why the extra check was introduced). That's why we restrict the second check to types with recursive super types, effectively restoring the previous behavior for all other types. #KT-65050 Fixed
This commit is contained in:
committed by
Space Team
parent
7587f73846
commit
582dd1d3c0
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// FIR_IDENTICAL
|
||||
// ISSUE: KT-65050
|
||||
|
||||
interface HttpResponse<T>
|
||||
|
||||
class GitLabMergeRequestShortRestDTO
|
||||
|
||||
fun loadMergeRequests(): HttpResponse<out List<GitLabMergeRequestShortRestDTO>> = TODO()
|
||||
|
||||
inline fun <reified T> loadList(): HttpResponse<out List<T>> = TODO()
|
||||
|
||||
fun loadMergeRequests(boolean: Boolean) {
|
||||
val response = if (boolean) {
|
||||
loadMergeRequests()
|
||||
} else {
|
||||
loadList()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user