FE: Add test for KT-56227 (to confirm it's fixed)

This commit is contained in:
Mikhail Glukhikh
2023-01-27 19:09:19 +01:00
committed by teamcity
parent ba3f21e125
commit 8bc2aaa295
6 changed files with 76 additions and 0 deletions
@@ -14972,6 +14972,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
public void testKt55931() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/callableReferences/kt55931.kt");
}
@Test
@TestMetadata("kt56227.kt")
public void testKt56227() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/callableReferences/kt56227.kt");
}
}
@Nested
@@ -14978,6 +14978,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
public void testKt55931() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/callableReferences/kt55931.kt");
}
@Test
@TestMetadata("kt56227.kt")
public void testKt56227() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/callableReferences/kt56227.kt");
}
}
@Nested
@@ -14972,6 +14972,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
public void testKt55931() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/callableReferences/kt55931.kt");
}
@Test
@TestMetadata("kt56227.kt")
public void testKt56227() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/callableReferences/kt56227.kt");
}
}
@Nested
@@ -0,0 +1,30 @@
// FIR_IDENTICAL
// WITH_REFLECT
import kotlin.reflect.KProperty0
data class MyPattern(
val name: String,
val conservation: String?,
val awake: Double,
val brainwt: Double?,
val bodywt: Double,
)
internal inline fun <reified T> Iterable<T>.ggplot4(
x: T.() -> KProperty0<*>,
y: T.() -> KProperty0<*>,
) {
// build df from data
val map = map { x(it) to y(it) }
map.first().first.name
TODO("do something meaningful")
}
fun main() {
listOf<MyPattern>().ggplot4(
x = { ::conservation },
y = { ::bodywt }
)
}
@@ -0,0 +1,22 @@
package
public fun main(): kotlin.Unit
internal inline fun </*0*/ reified T> kotlin.collections.Iterable<T>.ggplot4(/*0*/ x: T.() -> kotlin.reflect.KProperty0<*>, /*1*/ y: T.() -> kotlin.reflect.KProperty0<*>): kotlin.Unit
public final data class MyPattern {
public constructor MyPattern(/*0*/ name: kotlin.String, /*1*/ conservation: kotlin.String?, /*2*/ awake: kotlin.Double, /*3*/ brainwt: kotlin.Double?, /*4*/ bodywt: kotlin.Double)
public final val awake: kotlin.Double
public final val bodywt: kotlin.Double
public final val brainwt: kotlin.Double?
public final val conservation: kotlin.String?
public final val name: kotlin.String
public final operator /*synthesized*/ fun component1(): kotlin.String
public final operator /*synthesized*/ fun component2(): kotlin.String?
public final operator /*synthesized*/ fun component3(): kotlin.Double
public final operator /*synthesized*/ fun component4(): kotlin.Double?
public final operator /*synthesized*/ fun component5(): kotlin.Double
public final /*synthesized*/ fun copy(/*0*/ name: kotlin.String = ..., /*1*/ conservation: kotlin.String? = ..., /*2*/ awake: kotlin.Double = ..., /*3*/ brainwt: kotlin.Double? = ..., /*4*/ bodywt: kotlin.Double = ...): MyPattern
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}
@@ -14978,6 +14978,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
public void testKt55931() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/callableReferences/kt55931.kt");
}
@Test
@TestMetadata("kt56227.kt")
public void testKt56227() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/callableReferences/kt56227.kt");
}
}
@Nested