FirClassSubstitutionScope: don't recreate constructor type parameters w/out need
#KT-58008 Fixed
This commit is contained in:
committed by
Space Team
parent
5daafd5ed5
commit
1c56a71b14
@@ -4,7 +4,7 @@ public final inner [ResolvedTo(BODY_RESOLVE)] class ONAIR<[ResolvedTo(STATUS)] T
|
||||
}
|
||||
|
||||
public final [ResolvedTo(BODY_RESOLVE)] fun x(): R|X.Y<T>| {
|
||||
^x R|SubstitutionOverride</X.Y.Y>|<R|T|>()
|
||||
^x R|/X.Y.Y|<R|T|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ FILE: hashTableWithForEach.kt
|
||||
R|/DEBUG| -> {
|
||||
^ Q|java/util/Collections|.R|java/util/Collections.unmodifiableSet|<R|ft<kotlin/collections/MutableMap.MutableEntry<K, V>, kotlin/collections/MutableMap.MutableEntry<K, V>?>|>(R|kotlin/collections/mutableSetOf|<R|kotlin/collections/MutableMap.MutableEntry<K, V>|>().R|kotlin/apply|<R|kotlin/collections/MutableSet<kotlin/collections/MutableMap.MutableEntry<K, V>>|>(<L> = apply@fun R|kotlin/collections/MutableSet<kotlin/collections/MutableMap.MutableEntry<K, V>>|.<anonymous>(): R|kotlin/Unit| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
this@R|/SomeHashTable|.R|/SomeHashTable.forEach|(<L> = forEach@fun <anonymous>(key: R|@EnhancedNullability K|, value: R|@EnhancedNullability V|): R|kotlin/Unit| <inline=NoInline> {
|
||||
this@R|special/anonymous|.R|SubstitutionOverride<kotlin/collections/MutableSet.add: R|kotlin/Boolean|>|(R|SubstitutionOverride</SomeHashTable.Entry.Entry>|<R|K|, R|V|>(R|<local>/key|, R|<local>/value|))
|
||||
this@R|special/anonymous|.R|SubstitutionOverride<kotlin/collections/MutableSet.add: R|kotlin/Boolean|>|(R|/SomeHashTable.Entry.Entry|<R|K|, R|V|>(R|<local>/key|, R|<local>/value|))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ FILE: UastPatterns.kt
|
||||
^uExpression R|/expressionCapture|<R|UExpression|>(<getClass>(Q|UExpression|).R|kotlin/jvm/java|<R|UExpression|>)
|
||||
}
|
||||
public final fun <T : R|UExpression|> expressionCapture(clazz: R|java/lang/Class<T>|): R|UExpressionPattern.Capture<T>| {
|
||||
^expressionCapture Q|UExpressionPattern|.R|SubstitutionOverride</UExpressionPattern.Capture.Capture>|<R|T|>(R|<local>/clazz|)
|
||||
^expressionCapture Q|UExpressionPattern|.R|/UExpressionPattern.Capture.Capture|<R|T|>(R|<local>/clazz|)
|
||||
}
|
||||
public open class UElementPattern<T : R|UElement|, Self : R|UElementPattern<T, Self>|> : R|ObjectPattern<T, Self>| {
|
||||
public constructor<T : R|UElement|, Self : R|UElementPattern<T, Self>|>(clazz: R|java/lang/Class<T>|): R|UElementPattern<T, Self>| {
|
||||
|
||||
+4
-1
@@ -281,12 +281,15 @@ class FirClassSubstitutionScope(
|
||||
)
|
||||
|
||||
private fun createSubstitutedData(member: FirCallableDeclaration, symbolForOverride: FirBasedSymbol<*>): SubstitutedData {
|
||||
val memberOwnerClassLookupTag =
|
||||
if (member is FirConstructor) (member.returnTypeRef.coneType as ConeClassLikeType).lookupTag
|
||||
else member.dispatchReceiverClassLookupTagOrNull()
|
||||
val (newTypeParameters, substitutor) = FirFakeOverrideGenerator.createNewTypeParametersAndSubstitutor(
|
||||
session,
|
||||
member as FirTypeParameterRefsOwner,
|
||||
symbolForOverride,
|
||||
substitutor,
|
||||
forceTypeParametersRecreation = dispatchReceiverTypeForSubstitutedMembers.lookupTag != member.dispatchReceiverClassLookupTagOrNull()
|
||||
forceTypeParametersRecreation = dispatchReceiverTypeForSubstitutedMembers.lookupTag != memberOwnerClassLookupTag
|
||||
)
|
||||
|
||||
val receiverType = member.receiverParameter?.typeRef?.coneType
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// WITH_STDLIB
|
||||
// WITH_COROUTINES
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K2: JVM_IR
|
||||
// ISSUE: KT-58008
|
||||
|
||||
import kotlin.coroutines.*
|
||||
|
||||
Reference in New Issue
Block a user