[FE 1.0] Don't try to compute value parameters for variables while creating a flat signature for the overload resolution
^KT-50172 Fixed
This commit is contained in:
committed by
teamcity
parent
c998582e13
commit
e50e055eb4
+6
@@ -2933,6 +2933,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt50172.kt")
|
||||||
|
public void testKt50172() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
|
|||||||
+8
-3
@@ -9,6 +9,7 @@ import org.jetbrains.kotlin.builtins.getValueParameterTypesFromCallableReflectio
|
|||||||
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.MemberDescriptor
|
import org.jetbrains.kotlin.descriptors.MemberDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
|
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
|
||||||
|
import org.jetbrains.kotlin.descriptors.VariableDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.synthetic.SyntheticMemberDescriptor
|
import org.jetbrains.kotlin.descriptors.synthetic.SyntheticMemberDescriptor
|
||||||
import org.jetbrains.kotlin.resolve.calls.components.hasDefaultValue
|
import org.jetbrains.kotlin.resolve.calls.components.hasDefaultValue
|
||||||
import org.jetbrains.kotlin.types.KotlinType
|
import org.jetbrains.kotlin.types.KotlinType
|
||||||
@@ -28,9 +29,13 @@ fun <T> FlatSignature.Companion.createFromReflectionType(
|
|||||||
// have transient receiver which is not the same in its signature
|
// have transient receiver which is not the same in its signature
|
||||||
val receiver = descriptor.extensionReceiverParameter?.type
|
val receiver = descriptor.extensionReceiverParameter?.type
|
||||||
val contextReceiversTypes = descriptor.contextReceiverParameters.mapNotNull { it.type }
|
val contextReceiversTypes = descriptor.contextReceiverParameters.mapNotNull { it.type }
|
||||||
val parameters = reflectionType.getValueParameterTypesFromCallableReflectionType(
|
val parameters = if (descriptor is VariableDescriptor) {
|
||||||
receiver != null && !hasBoundExtensionReceiver
|
emptyList()
|
||||||
).map { it.type }
|
} else {
|
||||||
|
reflectionType.getValueParameterTypesFromCallableReflectionType(
|
||||||
|
receiver != null && !hasBoundExtensionReceiver
|
||||||
|
).map { it.type }
|
||||||
|
}
|
||||||
|
|
||||||
return FlatSignature(
|
return FlatSignature(
|
||||||
origin,
|
origin,
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
fun g(s: String): List<String> {
|
||||||
|
fun f(x: String): String = x + "K"
|
||||||
|
|
||||||
|
val f = f(s)
|
||||||
|
return listOf(s).map(::f)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String =
|
||||||
|
g("O").first()
|
||||||
+6
@@ -2855,6 +2855,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt50172.kt")
|
||||||
|
public void testKt50172() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
|
|||||||
+6
@@ -2933,6 +2933,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt50172.kt")
|
||||||
|
public void testKt50172() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
|
|||||||
+5
@@ -2505,6 +2505,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt50172.kt")
|
||||||
|
public void testKt50172() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/nested.kt");
|
runTest("compiler/testData/codegen/box/callableReference/nested.kt");
|
||||||
|
|||||||
+6
@@ -1895,6 +1895,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt50172.kt")
|
||||||
|
public void testKt50172() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
|
|||||||
+6
@@ -1937,6 +1937,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt50172.kt")
|
||||||
|
public void testKt50172() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
|
|||||||
+5
@@ -1730,6 +1730,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt50172.kt")
|
||||||
|
public void testKt50172() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/nested.kt");
|
runTest("compiler/testData/codegen/box/callableReference/nested.kt");
|
||||||
|
|||||||
+6
@@ -1961,6 +1961,12 @@ public class NativeExtBlackBoxTestGenerated extends AbstractNativeBlackBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt47988.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt50172.kt")
|
||||||
|
public void testKt50172() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user