From c336159b2bdb6edbe4bc4594bf4067466a16bd1e Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 19 Dec 2017 13:42:31 +0100 Subject: [PATCH] Don't show argument name hints for dynamic calls. Mark function descriptors created for dynamic calls as having synthesized parameter names. #KT-21275 Fixed --- .../jetbrains/kotlin/resolve/calls/tasks/dynamicCalls.kt | 1 + .../kotlin/idea/parameterInfo/InlayParameterHintsTest.kt | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/dynamicCalls.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/dynamicCalls.kt index 2db24ff4644..08ef0f2121d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/dynamicCalls.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/dynamicCalls.kt @@ -136,6 +136,7 @@ class DynamicCallableDescriptors(storageManager: StorageManager, builtIns: Kotli Modality.FINAL, Visibilities.PUBLIC ) + functionDescriptor.setHasSynthesizedParameterNames(true) return functionDescriptor } diff --git a/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/InlayParameterHintsTest.kt b/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/InlayParameterHintsTest.kt index 2c508e0cc98..c3ea64652b8 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/InlayParameterHintsTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/InlayParameterHintsTest.kt @@ -172,4 +172,10 @@ annotation class ManyArgs(val name: String, val surname: String) fun T.test(block: (receiver: T, Int) -> Unit) = block(this, 0) """) } + + fun `test dynamic`() { + check("""fun foo(x: dynamic) { + x.foo("123") + }""") + } }