FIR Java: fix exception during synthetic property enhancement

This commit is contained in:
Mikhail Glukhikh
2020-09-24 17:09:40 +03:00
parent 368de43623
commit ae23adb6f5
@@ -107,9 +107,14 @@ class FirSignatureEnhancement(
}
is FirSyntheticProperty -> {
val accessorSymbol = firElement.symbol
val enhancedFunctionSymbol = enhanceMethod(
firElement.getter.delegate, accessorSymbol.accessorId, accessorSymbol.accessorId.callableName
)
val getterDelegate = firElement.getter.delegate
val enhancedFunctionSymbol = if (getterDelegate is FirJavaMethod) {
enhanceMethod(
getterDelegate, accessorSymbol.accessorId, accessorSymbol.accessorId.callableName
)
} else {
getterDelegate.symbol
}
return buildSyntheticProperty {
session = this@FirSignatureEnhancement.session
this.name = name
@@ -324,8 +329,6 @@ class FirSignatureEnhancement(
return signatureParts.type
}
private val overrideBindCache = mutableMapOf<Name, Map<FirCallableSymbol<*>?, List<FirCallableSymbol<*>>>>()
private sealed class TypeInSignature {
abstract fun getTypeRef(member: FirCallableMemberDeclaration<*>): FirTypeRef