Add test for KT-37056 (already fixed)
This commit is contained in:
+5
@@ -715,6 +715,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/invokeWithReceiverAndArgument.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/invokeWithReceiverAndArgument.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt37056.kt")
|
||||||
|
public void testKt37056() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/kt37056.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("lambdaAsReceiver.kt")
|
@TestMetadata("lambdaAsReceiver.kt")
|
||||||
public void testLambdaAsReceiver() throws Exception {
|
public void testLambdaAsReceiver() throws Exception {
|
||||||
runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/lambdaAsReceiver.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/lambdaAsReceiver.kt");
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
FILE: kt37056.kt
|
||||||
|
public final fun case1(a: R|A?|): R|kotlin/Unit| {
|
||||||
|
lval test: R|kotlin/String?| = R|<local>/a|?.{ $subj$.R|kotlin/let|<R|A|, R|kotlin/String|>(<L> = let@fun <anonymous>(it: R|A|): R|kotlin/String| <kind=EXACTLY_ONCE> {
|
||||||
|
Q|Case1|.R|/Case1.Companion.invoke|(R|<local>/it|)
|
||||||
|
Q|Case1|.R|/Case1.Companion.invoke|(R|<local>/it|)
|
||||||
|
^ Q|Case1|.R|/Case1.Companion.invoke|(R|/A.A|())
|
||||||
|
}
|
||||||
|
) }
|
||||||
|
Q|Case1|.R|/Case1.Companion.invoke|(R|/A.A|())
|
||||||
|
Q|Case1|.R|/Case1.Companion.invoke|(a = R|/A.A|())
|
||||||
|
}
|
||||||
|
public final class Case1 : R|kotlin/Any| {
|
||||||
|
private constructor(a: R|A|): R|Case1| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
public final val a: R|A| = R|<local>/a|
|
||||||
|
public get(): R|A|
|
||||||
|
|
||||||
|
public final companion object Companion : R|kotlin/Any| {
|
||||||
|
private constructor(): R|Case1.Companion| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
public final operator fun invoke(a: R|A|): R|kotlin/String| {
|
||||||
|
^invoke String()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public final fun case2(a: R|A|): R|kotlin/Unit| {
|
||||||
|
Q|Case2|.R|/Case2.Companion.invoke|(R|<local>/a|)
|
||||||
|
Q|Case2|.R|/Case2.Companion.invoke|(a = R|<local>/a|)
|
||||||
|
}
|
||||||
|
public final class Case2 : R|kotlin/Any| {
|
||||||
|
public constructor(): R|Case2| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
public final companion object Companion : R|kotlin/Any| {
|
||||||
|
private constructor(): R|Case2.Companion| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
public final operator fun invoke(a: R|A|): R|kotlin/String| {
|
||||||
|
^invoke String()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public final class A : R|kotlin/Any| {
|
||||||
|
public constructor(): R|A| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
fun case1(a: A?) {
|
||||||
|
val test = a?.let {
|
||||||
|
|
||||||
|
Case1.invoke(it)
|
||||||
|
|
||||||
|
Case1(it)
|
||||||
|
|
||||||
|
Case1(A())
|
||||||
|
}
|
||||||
|
|
||||||
|
Case1(A())
|
||||||
|
Case1(a = A())
|
||||||
|
}
|
||||||
|
|
||||||
|
class Case1 private constructor(val a: A) {
|
||||||
|
companion object {
|
||||||
|
operator fun invoke(a: A) = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun case2(a: A) {
|
||||||
|
Case2(a)
|
||||||
|
Case2(a =a)
|
||||||
|
}
|
||||||
|
|
||||||
|
class Case2 {
|
||||||
|
companion object {
|
||||||
|
operator fun invoke(a: A) = "" //(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class A()
|
||||||
+6
@@ -827,6 +827,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/invokeWithReceiverAndArgument.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/invokeWithReceiverAndArgument.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt37056.kt")
|
||||||
|
public void testKt37056() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/kt37056.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("lambdaAsReceiver.kt")
|
@TestMetadata("lambdaAsReceiver.kt")
|
||||||
public void testLambdaAsReceiver() throws Exception {
|
public void testLambdaAsReceiver() throws Exception {
|
||||||
|
|||||||
+6
@@ -834,6 +834,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/invokeWithReceiverAndArgument.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/invokeWithReceiverAndArgument.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt37056.kt")
|
||||||
|
public void testKt37056() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/kt37056.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("lambdaAsReceiver.kt")
|
@TestMetadata("lambdaAsReceiver.kt")
|
||||||
public void testLambdaAsReceiver() throws Exception {
|
public void testLambdaAsReceiver() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user