Fix "PSI/index mismatch" in case of @ParameterName on non-functional types (KT-34524)

Original commit: ef698a5747103d21aa58e18a53ab7f366054e1d7

GitOrigin-RevId: c4a6aa00a8aa18213f754fa992904df633ed1cc9
This commit is contained in:
Yan Zhulanow
2020-06-03 18:55:54 +03:00
committed by intellij-monorepo-bot
parent 2c94f3eaeb
commit 5ad94836a4
4 changed files with 22 additions and 5 deletions
@@ -46,6 +46,11 @@ public class JvmDecompiledTextTestGenerated extends AbstractJvmDecompiledTextTes
runTest("testData/decompiler/decompiledTextJvm/PackageWithQuotes/");
}
@TestMetadata("ParameterName")
public void testParameterName() throws Exception {
runTest("testData/decompiler/decompiledTextJvm/ParameterName/");
}
@TestMetadata("TestKt")
public void testTestKt() throws Exception {
runTest("testData/decompiler/decompiledTextJvm/TestKt/");
@@ -0,0 +1,6 @@
// IntelliJ API Decompiler stub source generated from a class file
// Implementation of methods is not available
package test
public inline fun <A, B, C : kotlin.Any, D> test.Foo.Companion.foo(crossinline block: test.Context<B, C>.(A, B) -> D): kotlin.Unit { /* compiled code */ }
@@ -0,0 +1,10 @@
@file:JvmName("ParameterName")
package test
class Foo {
companion object
}
class Context<T, U>
inline fun <A, B, C : Any, D> Foo.Companion.foo(crossinline block: Context<B, C>.(input: A, state: B) -> D) {}
@@ -6,9 +6,5 @@ fun foo(a: Int, b: String, d: Baz) {
}
class TestClass(
val prop1: KFunction3<@ParameterName(name = "a") Int, @ParameterName(name = "b") String, @ParameterName(
name = "d"
) Baz, Unit> = ::foo
) {
class TestClass(val prop1: KFunction3<Int, String, Baz, Unit> = ::foo) {
}