IR: check absence of extension receiver in isMethodOfAny

Otherwise extension methods named toString/equals/hashCode were
generated incorrectly on JVM IR, which could result in
AbstractMethodError at runtime.

 #KT-45963 Fixed
This commit is contained in:
Alexander Udalov
2021-04-09 21:53:06 +02:00
parent 98d31a1813
commit ea22f4b681
10 changed files with 69 additions and 3 deletions
@@ -10764,6 +10764,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/extensionFunctions/kt865.kt");
}
@TestMetadata("memberExtensionEqualsHashCodeToStringInInterface.kt")
public void testMemberExtensionEqualsHashCodeToStringInInterface() throws Exception {
runTest("compiler/testData/codegen/box/extensionFunctions/memberExtensionEqualsHashCodeToStringInInterface.kt");
}
@TestMetadata("nested2.kt")
public void testNested2() throws Exception {
runTest("compiler/testData/codegen/box/extensionFunctions/nested2.kt");
@@ -10185,6 +10185,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/extensionFunctions/kt865.kt");
}
@TestMetadata("memberExtensionEqualsHashCodeToStringInInterface.kt")
public void testMemberExtensionEqualsHashCodeToStringInInterface() throws Exception {
runTest("compiler/testData/codegen/box/extensionFunctions/memberExtensionEqualsHashCodeToStringInInterface.kt");
}
@TestMetadata("nested2.kt")
public void testNested2() throws Exception {
runTest("compiler/testData/codegen/box/extensionFunctions/nested2.kt");
@@ -10185,6 +10185,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/extensionFunctions/kt865.kt");
}
@TestMetadata("memberExtensionEqualsHashCodeToStringInInterface.kt")
public void testMemberExtensionEqualsHashCodeToStringInInterface() throws Exception {
runTest("compiler/testData/codegen/box/extensionFunctions/memberExtensionEqualsHashCodeToStringInInterface.kt");
}
@TestMetadata("nested2.kt")
public void testNested2() throws Exception {
runTest("compiler/testData/codegen/box/extensionFunctions/nested2.kt");
@@ -5089,6 +5089,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/extensionFunctions/kt5467.kt");
}
@TestMetadata("memberExtensionEqualsHashCodeToStringInInterface.kt")
public void testMemberExtensionEqualsHashCodeToStringInInterface() throws Exception {
runTest("compiler/testData/codegen/box/extensionFunctions/memberExtensionEqualsHashCodeToStringInInterface.kt");
}
@TestMetadata("nested2.kt")
public void testNested2() throws Exception {
runTest("compiler/testData/codegen/box/extensionFunctions/nested2.kt");