[FIR] Copy java enum entry during enhancement instead of mutating it
#KT-57949 Fixed
This commit is contained in:
committed by
Space Team
parent
f5168527ae
commit
49e786f088
+8
-4
@@ -109,10 +109,14 @@ class FirSignatureEnhancement(
|
||||
)
|
||||
|
||||
val newReturnTypeRef = enhanceReturnType(firElement, emptyList(), firElement.computeDefaultQualifiers(), predefinedInfo)
|
||||
return firElement.symbol.apply {
|
||||
this.fir.replaceReturnTypeRef(newReturnTypeRef)
|
||||
session.lookupTracker?.recordTypeResolveAsLookup(newReturnTypeRef, this.fir.source, null)
|
||||
}
|
||||
|
||||
return buildEnumEntryCopy(firElement) {
|
||||
symbol = FirEnumEntrySymbol(firElement.symbol.callableId)
|
||||
returnTypeRef = newReturnTypeRef
|
||||
origin = FirDeclarationOrigin.Enhancement
|
||||
}.apply {
|
||||
session.lookupTracker?.recordTypeResolveAsLookup(newReturnTypeRef, this.source, null)
|
||||
}.symbol
|
||||
}
|
||||
is FirField -> {
|
||||
if (firElement.returnTypeRef !is FirJavaTypeRef) return original
|
||||
|
||||
Reference in New Issue
Block a user