[JVM IR] Maintain KT-36188 bug compatibility between non-IR and IR
backends.
This commit is contained in:
committed by
Alexander Udalov
parent
435e74b74b
commit
2239b5ceab
+8
-4
@@ -96,12 +96,16 @@ internal class InterfaceLowering(val context: JvmBackendContext) : IrElementTran
|
||||
* ```
|
||||
*/
|
||||
function.origin == IrDeclarationOrigin.FAKE_OVERRIDE -> {
|
||||
val implementation = function.resolveFakeOverride()!!
|
||||
// We check to see if this is a default stub function BEFORE finding the implementation because of a front-end bug
|
||||
// (KT-36188) where there could be multiple implementations. (resolveFakeOverride() only returns the implementation if
|
||||
// there's only one.)
|
||||
if (function.name.asString().endsWith("\$default")) {
|
||||
continue@loop
|
||||
}
|
||||
val implementation = function.resolveFakeOverride() ?: error("No single implementation found for: ${function.render()}")
|
||||
|
||||
when {
|
||||
Visibilities.isPrivate(implementation.visibility) ||
|
||||
implementation.isMethodOfAny() ||
|
||||
implementation.origin == IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER ->
|
||||
Visibilities.isPrivate(implementation.visibility) || implementation.isMethodOfAny() ->
|
||||
continue@loop
|
||||
!implementation.hasJvmDefault() -> {
|
||||
val defaultImpl = createDefaultImpl(function)
|
||||
|
||||
Reference in New Issue
Block a user