[FIR] Add dynamic stages to callable reference resolution
This fixes an overload resolution ambiguity on callable references in the presence of a dynamic extension receiver. #KT-58143 Fixed
This commit is contained in:
committed by
Space Team
parent
c16f2f1067
commit
d96c33e080
@@ -92,6 +92,8 @@ sealed class CallKind(vararg resolutionSequence: ResolutionStage) {
|
|||||||
CheckCallableReferenceExpectedType,
|
CheckCallableReferenceExpectedType,
|
||||||
CheckLowPriorityInOverloadResolution,
|
CheckLowPriorityInOverloadResolution,
|
||||||
CheckIncompatibleTypeVariableUpperBounds,
|
CheckIncompatibleTypeVariableUpperBounds,
|
||||||
|
ProcessDynamicExtensionAnnotation,
|
||||||
|
LowerPriorityIfDynamic,
|
||||||
)
|
)
|
||||||
|
|
||||||
object SyntheticIdForCallableReferencesResolution : CallKind(
|
object SyntheticIdForCallableReferencesResolution : CallKind(
|
||||||
|
|||||||
Vendored
+25
@@ -0,0 +1,25 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
// DIAGNOSTICS: -UNUSED_PARAMETER
|
||||||
|
|
||||||
|
fun <T : Any> jso(): T =
|
||||||
|
js("({})")
|
||||||
|
|
||||||
|
fun <T : Any> jso(
|
||||||
|
block: T.() -> Unit,
|
||||||
|
): T = jso<T>().apply(block)
|
||||||
|
|
||||||
|
object FooBar {
|
||||||
|
fun buildNodes() = jso<dynamic> {
|
||||||
|
this["code_block"] = ParseRuleBuilder.create(getAttrs = ::readCodeBlockAttrs)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun readCodeBlockAttrs() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
object ParseRuleBuilder {
|
||||||
|
fun create(
|
||||||
|
getAttrs: Any? = null,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
}
|
||||||
+6
@@ -229,6 +229,12 @@ public class DiagnosticsTestWithJsStdLibGenerated extends AbstractDiagnosticsTes
|
|||||||
runTest("compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/dynamicExtension.kt");
|
runTest("compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/dynamicExtension.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("dynamicExtensionCallableReference.kt")
|
||||||
|
public void testDynamicExtensionCallableReference() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/dynamicExtensionCallableReference.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("dynamicSafeCalls.kt")
|
@TestMetadata("dynamicSafeCalls.kt")
|
||||||
public void testDynamicSafeCalls() throws Exception {
|
public void testDynamicSafeCalls() throws Exception {
|
||||||
|
|||||||
+6
@@ -230,6 +230,12 @@ public class FirPsiJsOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiJ
|
|||||||
runTest("compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/dynamicExtension.kt");
|
runTest("compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/dynamicExtension.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("dynamicExtensionCallableReference.kt")
|
||||||
|
public void testDynamicExtensionCallableReference() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/dynamicExtensionCallableReference.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("dynamicSafeCalls.kt")
|
@TestMetadata("dynamicSafeCalls.kt")
|
||||||
public void testDynamicSafeCalls() throws Exception {
|
public void testDynamicSafeCalls() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user