K2: Do not use KFunctionN as representation type for adapted references

Beside some corner cases, it's already prohibited in K1 because
adaptation have a bit strange nature
(they don't represent any existing real function exactly)

^KT-55137 Fixed
This commit is contained in:
Denis.Zharkov
2022-11-25 18:19:10 +01:00
committed by Space Team
parent dcdc48a233
commit a38040680c
17 changed files with 102 additions and 18 deletions
@@ -3117,6 +3117,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/callableReference/adapted"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("noKFunctionForAdaptation.kt")
public void testNoKFunctionForAdaptation() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/adapted/noKFunctionForAdaptation.kt");
}
@Test
@TestMetadata("simpleAdaptationOutsideOfCall.kt")
public void testSimpleAdaptationOutsideOfCall() throws Exception {
@@ -18319,6 +18319,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/fir/assertEqualsFakeOverride.kt");
}
@Test
@TestMetadata("callableReferenceConversionTopLevel.kt")
public void testCallableReferenceConversionTopLevel() throws Exception {
runTest("compiler/testData/codegen/box/fir/callableReferenceConversionTopLevel.kt");
}
@Test
@TestMetadata("callableReferenceToJavaField.kt")
public void testCallableReferenceToJavaField() throws Exception {