Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,13 @@ internal class BridgeLowering(val context: JvmBackendContext) : ClassLoweringPas
isFinal = false,
)

// The part after '?:' is needed for methods with default implementations in collection interfaces:
// MutableMap.remove() and getOrDefault().
val superTarget = overriddenFromClass.takeIf { !it.isFakeOverride || !specialBridge.isOverriding }
?: specialBridge.overridden

if (superBridge.signature == superTarget.jvmMethod) {
if (superBridge.signature == targetFunction.jvmMethod) {
// If the resulting bridge to a super member matches the signature of the bridge callee,
// bridge is not needed.
irFunction
} else {
irClass.declarations.remove(irFunction)
irClass.addSpecialBridge(superBridge, superTarget)
irClass.addSpecialBridge(superBridge, targetFunction)
}
}

Expand Down
18 changes: 18 additions & 0 deletions compiler/testData/codegen/box/collections/kt72039.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// TARGET_BACKEND: JVM
// FULL_JDK
// FILE: kt72039.kt
fun box(): String {
Test1().test()
return "OK"
}

class Test1 : Test0()

// FILE: Test0.java
import java.util.concurrent.ConcurrentHashMap;

public class Test0 extends ConcurrentHashMap<String, String> {
public void test() {
new Test1().keySet();
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.