Update test for the builder inference and add new ones
This commit is contained in:
+12
-6
@@ -12680,12 +12680,24 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesErrorTypeUnrestricted.kt")
|
||||
public void testSpecialCallsWithCallableReferencesErrorTypeUnrestricted() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorTypeUnrestricted.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt")
|
||||
public void testSpecialCallsWithCallableReferencesNonStrictOnlyInputTypes() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesUnrestricted.kt")
|
||||
public void testSpecialCallsWithCallableReferencesUnrestricted() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesUnrestricted.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithLambdas.kt")
|
||||
public void testSpecialCallsWithLambdas() throws Exception {
|
||||
@@ -12706,12 +12718,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
public void testViolating() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/constraints/violating.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("withExpectedType.kt")
|
||||
public void testWithExpectedType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/constraints/withExpectedType.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
+12
-6
@@ -12680,12 +12680,24 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesErrorTypeUnrestricted.kt")
|
||||
public void testSpecialCallsWithCallableReferencesErrorTypeUnrestricted() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorTypeUnrestricted.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt")
|
||||
public void testSpecialCallsWithCallableReferencesNonStrictOnlyInputTypes() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesUnrestricted.kt")
|
||||
public void testSpecialCallsWithCallableReferencesUnrestricted() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesUnrestricted.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithLambdas.kt")
|
||||
public void testSpecialCallsWithLambdas() throws Exception {
|
||||
@@ -12706,12 +12718,6 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
public void testViolating() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/constraints/violating.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("withExpectedType.kt")
|
||||
public void testWithExpectedType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/constraints/withExpectedType.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
+78
@@ -17587,18 +17587,78 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/callableReferencesProperCompletion.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("capturedTypes.kt")
|
||||
public void testCapturedTypes() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/capturedTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("commonSuperType.kt")
|
||||
public void testCommonSuperType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("commonSuperTypeContravariant.kt")
|
||||
public void testCommonSuperTypeContravariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeContravariant.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("commonSuperTypeCovariant.kt")
|
||||
public void testCommonSuperTypeCovariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeCovariant.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("commonSuperTypeInvariant.kt")
|
||||
public void testCommonSuperTypeInvariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeInvariant.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("commonSuperTypeNullable.kt")
|
||||
public void testCommonSuperTypeNullable() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intersect.kt")
|
||||
public void testIntersect() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/intersect.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt41164.kt")
|
||||
public void testKt41164() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt41164.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("labaledCall.kt")
|
||||
public void testLabaledCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/labaledCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lackOfNullCheckOnNullableInsideBuild.kt")
|
||||
public void testLackOfNullCheckOnNullableInsideBuild() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("memberScope.kt")
|
||||
public void testMemberScope() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/memberScope.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullability.kt")
|
||||
public void testNullability() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/nullability.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propagateInferenceSessionIntoDeclarationAnalyzers.kt")
|
||||
public void testPropagateInferenceSessionIntoDeclarationAnalyzers() throws Exception {
|
||||
@@ -17617,6 +17677,18 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExpression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontCareTypeInBlockExression() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontRewriteAtSlice.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontRewriteAtSlice() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesErrorType.kt")
|
||||
public void testSpecialCallsWithCallableReferencesErrorType() throws Exception {
|
||||
@@ -17682,6 +17754,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
public void testTopDownCompletionWithTwoBuilderInferenceCalls() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithTwoBuilderInferenceCalls.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("withExpectedType.kt")
|
||||
public void testWithExpectedType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/withExpectedType.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// WITH_RUNTIME
|
||||
|
||||
// FILE: main.kt
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R> build(@BuilderInference block: TestInterface<R>.() -> Unit) {}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R> build2(@BuilderInference block: TestInterface<R>.() -> Unit) {}
|
||||
|
||||
interface TestInterface<R> {
|
||||
fun emit(r: R)
|
||||
fun get(): R
|
||||
fun getInv(): Inv<R>
|
||||
fun getOut(): Inv<out R>
|
||||
fun getIn(): Inv<in R>
|
||||
}
|
||||
|
||||
class Inv<T>
|
||||
|
||||
fun <K> captureOut(x: Inv<out K>): K = null as K
|
||||
fun <K> captureIn(x: Inv<out K>): K = null as K
|
||||
fun <K> capture(x: Inv<K>): K = null as K
|
||||
|
||||
fun box(): String {
|
||||
build {
|
||||
emit("")
|
||||
getInv()
|
||||
captureOut(getInv())
|
||||
captureIn(getInv())
|
||||
|
||||
capture(getOut())
|
||||
""
|
||||
}
|
||||
build {
|
||||
emit("")
|
||||
capture(getIn())
|
||||
""
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -DEPRECATION -EXPERIMENTAL_IS_NOT_ENABLED -UNUSED_VARIABLE
|
||||
// WITH_RUNTIME
|
||||
|
||||
// FILE: Test.java
|
||||
|
||||
class Test {
|
||||
static <T> T foo(T x) { return x; }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R> build(@BuilderInference block: TestInterface<R>.() -> Unit) {}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R> build2(@BuilderInference block: TestInterface<R>.() -> Unit) {}
|
||||
|
||||
class Inv<K>
|
||||
|
||||
interface TestInterface<R> {
|
||||
fun emit(r: R)
|
||||
fun get(): R
|
||||
fun getInv(): Inv<R>
|
||||
}
|
||||
|
||||
fun <U> id(x: U) = x
|
||||
fun <E> select(vararg x: E) = x[0]
|
||||
|
||||
fun box(): String {
|
||||
val ret = build {
|
||||
emit("1")
|
||||
Test.foo(get())
|
||||
Test.foo(getInv())
|
||||
id(get())
|
||||
select(get(), get())
|
||||
select(Test.foo(get()), Test.foo(get()))
|
||||
select(Test.foo(get()), get())
|
||||
select(getInv(), getInv())
|
||||
select(Test.foo(getInv()), Test.foo(getInv()))
|
||||
select(Test.foo(getInv()), getInv())
|
||||
select(getInv(), Test.foo(getInv()))
|
||||
select(id(get()), id(get()))
|
||||
build2 {
|
||||
emit(1)
|
||||
select(this@build.get(), get())
|
||||
select(Test.foo(this@build.get()), Test.foo(get()))
|
||||
select(this@build.getInv(), getInv())
|
||||
select(Test.foo(this@build.getInv()), Test.foo(getInv()))
|
||||
select(Test.foo(this@build.getInv()), getInv())
|
||||
select(id(this@build.get()), id(get()))
|
||||
""
|
||||
}
|
||||
""
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// WITH_RUNTIME
|
||||
|
||||
// FILE: Test.java
|
||||
|
||||
class Test {
|
||||
static <T> T foo(T x) { return x; }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R1> build(@BuilderInference block: TestInterface<R1>.() -> Unit) {}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R2> build2(@BuilderInference block: TestInterface<R2>.() -> Unit) {}
|
||||
|
||||
class In<in K>
|
||||
|
||||
interface TestInterface<R> {
|
||||
fun emit(r: R)
|
||||
fun get(): R
|
||||
fun getIn(): In<R>
|
||||
}
|
||||
|
||||
fun <U> id(x: U): U? = x
|
||||
fun <E> select1(x: E, y: In<E>): E? = x
|
||||
fun <E> select2(x: E, y: In<E?>): E = x
|
||||
fun <E> select3(x: E?, y: In<E?>): E = x!!
|
||||
fun <E> select4(x: E?, y: In<E>): E = x!!
|
||||
|
||||
fun box(): String {
|
||||
val ret = build {
|
||||
emit("1")
|
||||
select1(get(), getIn())
|
||||
select1(get(), Test.foo(getIn()))
|
||||
select1(Test.foo(get()), Test.foo(getIn()))
|
||||
select1(Test.foo(get()), getIn())
|
||||
select4(get(), getIn())
|
||||
select4(get(), Test.foo(getIn()))
|
||||
select4(Test.foo(get()), Test.foo(getIn()))
|
||||
select4(Test.foo(get()), getIn())
|
||||
|
||||
select4(id(Test.foo(get())), getIn())
|
||||
""
|
||||
}
|
||||
val ret2 = build {
|
||||
emit(if (true) "" else null)
|
||||
select2(get(), getIn())
|
||||
select2(get(), Test.foo(getIn()))
|
||||
select2(Test.foo(get()), Test.foo(getIn()))
|
||||
select2(Test.foo(get()), getIn())
|
||||
select3(get(), getIn())
|
||||
select3(get(), Test.foo(getIn()))
|
||||
select3(Test.foo(get()), Test.foo(getIn()))
|
||||
select3(Test.foo(get()), getIn())
|
||||
""
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -DEPRECATION -EXPERIMENTAL_IS_NOT_ENABLED -UNUSED_VARIABLE
|
||||
// WITH_RUNTIME
|
||||
|
||||
// FILE: Test.java
|
||||
|
||||
class Test {
|
||||
static <T> T foo(T x) { return x; }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R1> build(@BuilderInference block: TestInterface<R1>.() -> Unit) {}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R2> build2(@BuilderInference block: TestInterface<R2>.() -> Unit) {}
|
||||
|
||||
class Out<out K>
|
||||
|
||||
interface TestInterface<R> {
|
||||
fun emit(r: R)
|
||||
fun get(): R
|
||||
fun getOut(): Out<R>
|
||||
}
|
||||
|
||||
fun <U> id(x: U): U? = x
|
||||
fun <E> select1(x: E, y: Out<E>): E? = x
|
||||
fun <E> select2(x: E, y: Out<E?>): E = x
|
||||
fun <E> select3(x: E?, y: Out<E?>): E = x!!
|
||||
fun <E> select4(x: E?, y: Out<E>): E = x!!
|
||||
|
||||
fun box(): String {
|
||||
val ret = build {
|
||||
emit("1")
|
||||
select1(get(), getOut())
|
||||
select1(get(), Test.foo(getOut()))
|
||||
select1(Test.foo(get()), Test.foo(getOut()))
|
||||
select1(Test.foo(get()), getOut())
|
||||
select2(get(), getOut())
|
||||
select2(get(), Test.foo(getOut()))
|
||||
select2(Test.foo(get()), Test.foo(getOut()))
|
||||
select2(Test.foo(get()), getOut())
|
||||
select3(get(), getOut())
|
||||
select3(get(), Test.foo(getOut()))
|
||||
select3(Test.foo(get()), Test.foo(getOut()))
|
||||
select3(Test.foo(get()), getOut())
|
||||
select4(get(), getOut())
|
||||
select4(get(), Test.foo(getOut()))
|
||||
select4(Test.foo(get()), Test.foo(getOut()))
|
||||
select4(Test.foo(get()), getOut())
|
||||
|
||||
select4(id(Test.foo(get())), getOut())
|
||||
|
||||
build2 {
|
||||
emit(1)
|
||||
select1(this@build.get(), getOut())
|
||||
select1(get(), Test.foo(this@build.getOut()))
|
||||
select1(Test.foo(this@build.get()), Test.foo(getOut()))
|
||||
select1(Test.foo(get()), this@build.getOut())
|
||||
select2(this@build.get(), getOut())
|
||||
select2(get(), Test.foo(this@build.getOut()))
|
||||
select2(Test.foo(this@build.get()), Test.foo(getOut()))
|
||||
select2(Test.foo(get()), this@build.getOut())
|
||||
select3(this@build.get(), getOut())
|
||||
select3(get(), Test.foo(this@build.getOut()))
|
||||
select3(Test.foo(this@build.get()), Test.foo(getOut()))
|
||||
select3(Test.foo(get()), this@build.getOut())
|
||||
select4(this@build.get(), getOut())
|
||||
select4(get(), Test.foo(this@build.getOut()))
|
||||
select4(Test.foo(this@build.get()), Test.foo(getOut()))
|
||||
select4(Test.foo(get()), this@build.getOut())
|
||||
|
||||
select4(id(Test.foo(this@build.get())), getOut())
|
||||
""
|
||||
}
|
||||
""
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -DEPRECATION -EXPERIMENTAL_IS_NOT_ENABLED -UNUSED_VARIABLE
|
||||
// WITH_RUNTIME
|
||||
|
||||
// FILE: Test.java
|
||||
|
||||
class Test {
|
||||
static <T> T foo(T x) { return x; }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R1> build(@BuilderInference block: TestInterface<R1>.() -> Unit) {}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R2> build2(@BuilderInference block: TestInterface<R2>.() -> Unit) {}
|
||||
|
||||
class Inv<K>
|
||||
|
||||
interface TestInterface<R> {
|
||||
fun emit(r: R)
|
||||
fun get(): R
|
||||
fun getInv(): Inv<R>
|
||||
}
|
||||
|
||||
fun <U> id(x: U): U? = x
|
||||
fun <E> select1(x: E, y: Inv<E>): E? = x
|
||||
fun <E> select2(x: E, y: Inv<E?>): E = x
|
||||
fun <E> select3(x: E?, y: Inv<E?>): E = x!!
|
||||
fun <E> select4(x: E?, y: Inv<E>): E = x!!
|
||||
|
||||
fun box(): String {
|
||||
val ret1 = build {
|
||||
emit("1")
|
||||
select1(get(), getInv())
|
||||
select1(get(), Test.foo(getInv()))
|
||||
select1(Test.foo(get()), Test.foo(getInv()))
|
||||
select1(Test.foo(get()), getInv())
|
||||
select4(get(), getInv())
|
||||
select4(get(), Test.foo(getInv()))
|
||||
select4(Test.foo(get()), Test.foo(getInv()))
|
||||
select4(Test.foo(get()), getInv())
|
||||
|
||||
select4(id(Test.foo(get())), getInv())
|
||||
""
|
||||
}
|
||||
|
||||
val ret2 = build {
|
||||
emit(if (true) "1" else null)
|
||||
select2(get(), getInv())
|
||||
select2(get(), Test.foo(getInv()))
|
||||
select2(Test.foo(get()), Test.foo(getInv()))
|
||||
select2(Test.foo(get()), getInv())
|
||||
select3(get(), getInv())
|
||||
select3(get(), Test.foo(getInv()))
|
||||
select3(Test.foo(get()), Test.foo(getInv()))
|
||||
select3(Test.foo(get()), getInv())
|
||||
""
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -DEPRECATION -EXPERIMENTAL_IS_NOT_ENABLED -UNUSED_VARIABLE
|
||||
// WITH_RUNTIME
|
||||
|
||||
// FILE: Test.java
|
||||
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
class Test {
|
||||
@Nullable
|
||||
static <T> T foo(T x) { return x; }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R> build(@BuilderInference block: TestInterface<R>.() -> Unit) {}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R> build2(@BuilderInference block: TestInterface<R>.() -> Unit) {}
|
||||
|
||||
class Inv<K>
|
||||
|
||||
interface TestInterface<R> {
|
||||
fun emit(r: R)
|
||||
fun get(): R
|
||||
fun getInv(): Inv<R>
|
||||
}
|
||||
|
||||
fun <U> id(x: U): U? = x
|
||||
fun <E> select(vararg x: E): E? = x[0]
|
||||
|
||||
fun box(): String {
|
||||
val ret = build {
|
||||
emit("1")
|
||||
Test.foo(get())
|
||||
Test.foo(getInv())
|
||||
id(get())
|
||||
select(get(), get())
|
||||
select(Test.foo(get()), Test.foo(get()))
|
||||
select(Test.foo(get()), get())
|
||||
select(getInv(), getInv())
|
||||
select(Test.foo(getInv()), Test.foo(getInv()))
|
||||
select(Test.foo(getInv()), getInv())
|
||||
select(getInv(), Test.foo(getInv()))
|
||||
select(id(get()), id(get()))
|
||||
build2 {
|
||||
emit(1)
|
||||
select(this@build.get(), get())
|
||||
select(Test.foo(this@build.get()), Test.foo(get()))
|
||||
select(this@build.getInv(), getInv())
|
||||
select(Test.foo(this@build.getInv()), Test.foo(getInv()))
|
||||
select(Test.foo(this@build.getInv()), getInv())
|
||||
select(id(this@build.get()), id(get()))
|
||||
""
|
||||
}
|
||||
""
|
||||
}
|
||||
val ret2 = build {
|
||||
emit("1")
|
||||
select(get(), null)
|
||||
select(Test.foo(null), Test.foo(get()))
|
||||
select(Test.foo(get()), null)
|
||||
select(null, getInv())
|
||||
select(Test.foo(getInv()), Test.foo(null))
|
||||
select(Test.foo(null), getInv())
|
||||
select(getInv(), Test.foo(null))
|
||||
select(id(null), id(get()))
|
||||
build2 {
|
||||
emit(1)
|
||||
select(this@build.get(), get(), null)
|
||||
select(Test.foo(this@build.get()), Test.foo(get()), null)
|
||||
select(this@build.getInv(), getInv(), null)
|
||||
select(Test.foo(this@build.getInv()), Test.foo(getInv()), null)
|
||||
select(Test.foo(this@build.getInv()), getInv(), null)
|
||||
select(id(this@build.get()), id(get()), null)
|
||||
""
|
||||
}
|
||||
""
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// WITH_RUNTIME
|
||||
|
||||
// FILE: Test.java
|
||||
|
||||
class Test {
|
||||
static <T> T foo(T x) { return x; }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R1> build(@BuilderInference block: TestInterface<R1>.() -> Unit) {}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R2> build2(@BuilderInference block: TestInterface<R2>.() -> Unit) {}
|
||||
|
||||
class In<in K>
|
||||
|
||||
interface TestInterface<R> {
|
||||
fun emit(r: R)
|
||||
fun get(): R
|
||||
fun getIn(): In<R>
|
||||
}
|
||||
|
||||
fun <U> id(x: U) = x
|
||||
fun <E> intersect(vararg x: In<E>): E = null as E
|
||||
|
||||
fun box(): String {
|
||||
val ret = build {
|
||||
emit("1")
|
||||
intersect(getIn(), getIn())
|
||||
intersect(getIn(), Test.foo(getIn()))
|
||||
intersect(Test.foo(getIn()), Test.foo(getIn()))
|
||||
intersect(Test.foo(getIn()), getIn())
|
||||
|
||||
build2 {
|
||||
emit(1)
|
||||
intersect(this@build.getIn(), getIn())
|
||||
intersect(getIn(), Test.foo(this@build.getIn()))
|
||||
intersect(Test.foo(this@build.getIn()), Test.foo(getIn()))
|
||||
intersect(Test.foo(getIn()), this@build.getIn())
|
||||
""
|
||||
}
|
||||
""
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -DEPRECATION -UNCHECKED_CAST -EXPERIMENTAL_IS_NOT_ENABLED -UNUSED_VARIABLE
|
||||
// WITH_RUNTIME
|
||||
|
||||
// FILE: main.kt
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R> build(@BuilderInference block: TestInterface<R>.() -> Unit) {}
|
||||
|
||||
interface TestInterface<R> {
|
||||
fun emit(r: R)
|
||||
fun get(): R
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
build myLabel@ {
|
||||
emit("")
|
||||
val x = this@myLabel
|
||||
""
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// !DIAGNOSTICS: -DEPRECATION -EXPERIMENTAL_IS_NOT_ENABLED
|
||||
// WITH_RUNTIME
|
||||
|
||||
// FILE: main.kt
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
interface TestInterface<R> {
|
||||
fun emit(r: R)
|
||||
fun get(): R
|
||||
}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R1> build(@BuilderInference block: TestInterface<R1>.() -> Unit) {}
|
||||
|
||||
fun Any.test() {}
|
||||
fun Any?.test2() {}
|
||||
|
||||
fun box(): String {
|
||||
val ret = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
get()?.test()
|
||||
get()?.test2()
|
||||
get().test2()
|
||||
get()?.hashCode()
|
||||
get()?.equals(1)
|
||||
val x = get()
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
|
||||
if (get() == null) {}
|
||||
if (get() === null) {}
|
||||
|
||||
if (x != null) {
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
x.equals("")
|
||||
x.hashCode()
|
||||
x.toString()
|
||||
x.test()
|
||||
x?.test2()
|
||||
x.test2()
|
||||
}
|
||||
|
||||
if (x == null) {
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
// x.equals("") // it'd be an error, because here we try to add constraint `Nothing? < Any`
|
||||
// x.hashCode()
|
||||
// x.toString()
|
||||
// x.test()
|
||||
x?.test2()
|
||||
x.test2()
|
||||
}
|
||||
|
||||
if (x === null) {
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
// x.equals("") // it'd be an error, because here we try to add constraint `Nothing? < Any`
|
||||
// x.hashCode()
|
||||
// x.toString()
|
||||
// x.test()
|
||||
x?.test2()
|
||||
x.test2()
|
||||
}
|
||||
|
||||
""
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// !DIAGNOSTICS: -DEPRECATION -EXPERIMENTAL_IS_NOT_ENABLED
|
||||
// WITH_RUNTIME
|
||||
|
||||
// FILE: main.kt
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
interface TestInterface<R> {
|
||||
fun emit(r: R)
|
||||
fun get(): R
|
||||
}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R1> build(@BuilderInference block: TestInterface<R1>.() -> Unit) {}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R1 : Any> build2(@BuilderInference block: TestInterface<R1>.() -> Unit) {}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R1 : R2, R2 : Any> build3(@BuilderInference block: TestInterface<R1>.() -> Unit) {}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R1 : R2, R2> build4(x: R2, @BuilderInference block: TestInterface<R1>.() -> Unit) {}
|
||||
|
||||
fun test(a: String?) {
|
||||
val ret1 = build {
|
||||
emit(1)
|
||||
get()?.equals("")
|
||||
val x = get()
|
||||
x?.equals("")
|
||||
x ?: 1
|
||||
x!!
|
||||
""
|
||||
}
|
||||
val ret2 = build2 {
|
||||
emit(1)
|
||||
get()?.equals("")
|
||||
val x = get()
|
||||
x?.equals("")
|
||||
x ?: 1
|
||||
x!!
|
||||
""
|
||||
}
|
||||
val ret3 = build3 {
|
||||
emit(1)
|
||||
get()?.equals("")
|
||||
val x = get()
|
||||
x?.equals("")
|
||||
x ?: 1
|
||||
x!!
|
||||
""
|
||||
}
|
||||
val ret4 = build4(1) {
|
||||
emit(1)
|
||||
get()?.equals("")
|
||||
val x = get()
|
||||
x?.equals("")
|
||||
x ?: 1
|
||||
x!!
|
||||
""
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
test("")
|
||||
return "OK"
|
||||
}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// WITH_RUNTIME
|
||||
// SKIP_TXT
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
fun <K> FlowCollector<K>.bar(): K = null as K
|
||||
fun <K> FlowCollector<K>.foo(): K = null as K
|
||||
|
||||
fun <K> K.bar3(): K = null as K
|
||||
fun <K> K.foo3(): K = null as K
|
||||
|
||||
fun bar2(): Int = 1
|
||||
fun foo2(): Float = 1f
|
||||
|
||||
val bar4: Int
|
||||
get() = 1
|
||||
|
||||
var foo4: Float
|
||||
get() = 1f
|
||||
set(value) {}
|
||||
|
||||
val <K> FlowCollector<K>.bar5: K get() = null as K
|
||||
val <K> FlowCollector<K>.foo5: K get() = null as K
|
||||
|
||||
class Foo6
|
||||
|
||||
class Foo7<T>
|
||||
fun foo7() = null as Foo7<Int>
|
||||
|
||||
interface FlowCollector<in T> {}
|
||||
|
||||
@OptIn(ExperimentalTypeInference::class)
|
||||
fun <L> flow(@BuilderInference block: suspend FlowCollector<L>.() -> Unit) = Flow(block)
|
||||
|
||||
class Flow<out R>(private val block: suspend FlowCollector<R>.() -> Unit)
|
||||
|
||||
fun poll1(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar2 } else { ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll11(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar2 } else { ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll12(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar3 } else { ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll13(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar2 } else { ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll14(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar4 } else { ::foo4 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll15(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar5 } else { ::foo5 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll16(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::Foo6 } else { ::Foo6 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll4(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar } finally { ::foo }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll41(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar2 } finally { ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll42(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar3 } finally { ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll43(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar4 } finally { ::foo4 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll44(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar5 } finally { ::foo5 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll45(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::Foo6 } finally { ::Foo6 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll5(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar } catch (e: Exception) { ::foo } finally { ::foo }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll51(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar2 } catch (e: Exception) { ::foo2 } finally { ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll52(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar3 } catch (e: Exception) { ::foo3 } finally { ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll53(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar4 } catch (e: Exception) { ::foo4 } finally { ::foo4 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll54(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar5 } catch (e: Exception) { ::foo5 } finally { ::foo5 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll55(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::Foo6 } catch (e: Exception) { ::Foo6 } finally { ::Foo6 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = "OK"
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
// WITH_RUNTIME
|
||||
// SKIP_TXT
|
||||
// !DIAGNOSTICS: -CAST_NEVER_SUCCEEDS -UNCHECKED_CAST -UNUSED_PARAMETER -UNUSED_VARIABLE -EXPERIMENTAL_API_USAGE_ERROR -UNUSED_EXPRESSION
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
fun <K> FlowCollector<K>.bar(): K = null as K
|
||||
fun <K> FlowCollector<K>.foo(): K = null as K
|
||||
|
||||
fun <K> K.bar3(): K = null as K
|
||||
fun <K> K.foo3(): K = null as K
|
||||
|
||||
fun bar2(): Int = 1
|
||||
fun foo2(): Float = 1f
|
||||
|
||||
val bar4: Int
|
||||
get() = 1
|
||||
|
||||
var foo4: Float
|
||||
get() = 1f
|
||||
set(value) {}
|
||||
|
||||
val <K> FlowCollector<K>.bar5: K get() = null as K
|
||||
val <K> FlowCollector<K>.foo5: K get() = null as K
|
||||
|
||||
class Foo6
|
||||
|
||||
class Foo7<T>
|
||||
fun foo7() = null as Foo7<Int>
|
||||
|
||||
interface FlowCollector<in T> {}
|
||||
|
||||
@OptIn(ExperimentalTypeInference::class)
|
||||
fun <L> flow(@BuilderInference block: suspend FlowCollector<L>.() -> Unit) = Flow(block)
|
||||
|
||||
class Flow<out R>(private val block: suspend FlowCollector<R>.() -> Unit)
|
||||
|
||||
fun poll71(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar2!!
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll73(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar4!!
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll75(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo6!!
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll85(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo6 in setOf(::Foo6)
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = "OK"
|
||||
+13
-2
@@ -2,24 +2,33 @@
|
||||
// WITH_RUNTIME
|
||||
// !DIAGNOSTICS: -EXPERIMENTAL_API_USAGE_ERROR -CAST_NEVER_SUCCEEDS
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
fun <K> id(x: K): K = x
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <K, V> build(@BuilderInference builderAction: MutableMap<K, V>.() -> V) {}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <K, V> build2(@BuilderInference builderAction: MutableMap<K, V>.() -> K) {}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <K, V> build3(@BuilderInference builderAction: MutableMap<K, V>.(K) -> Unit) {}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <K, V> build4(@BuilderInference builderAction: MutableMap<K, V>.() -> MutableMap<String, Int>) {}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <K : V, V : CharSequence> build5(@BuilderInference builderAction: MutableMap<K, V>.() -> MutableMap<String, V>) {}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <K : V, V : CharSequence> build6(@BuilderInference builderAction: MutableMap<K, V>.() -> MutableMap<K, String>) {}
|
||||
|
||||
fun <K : V, V : CharSequence> build7(@BuilderInference builderAction: MutableMap<K, V>.() -> MutableMap<String, V>) = null as MutableMap<String, V>
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <K : V, V : CharSequence> build7(@BuilderInference builderAction: MutableMap<K, V>.() -> MutableMap<String, V>) = mutableMapOf<String, V>()
|
||||
|
||||
@ExperimentalStdlibApi
|
||||
fun main() {
|
||||
fun box(): String {
|
||||
buildList {
|
||||
add("")
|
||||
val x: MutableList<CharSequence> = this@buildList
|
||||
@@ -62,6 +71,8 @@ fun main() {
|
||||
val x: MutableMap<String, CharSequence> = build7 {
|
||||
id(run { this })
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
fun MutableMap<String, Int>.foo() {}
|
||||
+1
-1
@@ -21,7 +21,7 @@ fun test(l : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.util.List<Int><!>) {
|
||||
|
||||
val f : java.io.File? = null
|
||||
|
||||
Collections.<!FUNCTION_CALL_EXPECTED, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>emptyList<!>
|
||||
Collections.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, FUNCTION_CALL_EXPECTED, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>emptyList<!>
|
||||
Collections.<!FUNCTION_CALL_EXPECTED!>emptyList<Int><!>
|
||||
Collections.emptyList<Int>()
|
||||
Collections.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>emptyList<!>()
|
||||
|
||||
Vendored
-69
@@ -1,69 +0,0 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// WITH_RUNTIME
|
||||
// !DIAGNOSTICS: -EXPERIMENTAL_API_USAGE_ERROR -CAST_NEVER_SUCCEEDS
|
||||
|
||||
fun <K> id(x: K): K = x
|
||||
|
||||
fun <K, V> build(@BuilderInference builderAction: MutableMap<K, V>.() -> V) {}
|
||||
|
||||
fun <K, V> build2(@BuilderInference builderAction: MutableMap<K, V>.() -> K) {}
|
||||
|
||||
fun <K, V> build3(@BuilderInference builderAction: MutableMap<K, V>.(K) -> Unit) {}
|
||||
|
||||
fun <K, V> build4(@BuilderInference builderAction: MutableMap<K, V>.() -> MutableMap<String, Int>) {}
|
||||
|
||||
fun <K : V, V : CharSequence> build5(@BuilderInference builderAction: MutableMap<K, V>.() -> MutableMap<String, V>) {}
|
||||
|
||||
fun <K : V, V : CharSequence> build6(@BuilderInference builderAction: MutableMap<K, V>.() -> MutableMap<K, String>) {}
|
||||
|
||||
fun <K : V, V : CharSequence> build7(@BuilderInference builderAction: MutableMap<K, V>.() -> MutableMap<String, V>) = null as MutableMap<String, V>
|
||||
|
||||
@ExperimentalStdlibApi
|
||||
fun main() {
|
||||
buildList {
|
||||
add("")
|
||||
val x: MutableList<CharSequence> = this@buildList
|
||||
}
|
||||
buildMap {
|
||||
val x: Function2<String, Char, Char?> = ::put
|
||||
}
|
||||
|
||||
build {
|
||||
get("")
|
||||
""
|
||||
}
|
||||
|
||||
build2 {
|
||||
val x: String = this.values.first()
|
||||
1
|
||||
}
|
||||
|
||||
build2 {
|
||||
take(this.values.first())
|
||||
1
|
||||
}
|
||||
|
||||
build3 { key: String ->
|
||||
take(this.values.first())
|
||||
}
|
||||
|
||||
build3 { this.foo() }
|
||||
|
||||
build4 { this }
|
||||
|
||||
build4 { this.run { this } }
|
||||
|
||||
build4 { run { this } }
|
||||
build4 { id(run { this }) }
|
||||
|
||||
build5 { id(run { this }) }
|
||||
build6 { id(run { this }) }
|
||||
|
||||
val x: MutableMap<String, CharSequence> = build7 {
|
||||
id(run { this })
|
||||
}
|
||||
}
|
||||
|
||||
fun MutableMap<String, Int>.foo() {}
|
||||
|
||||
fun take(x: String) {}
|
||||
Vendored
-14
@@ -1,14 +0,0 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ K, /*1*/ V> build(/*0*/ @kotlin.BuilderInference builderAction: kotlin.collections.MutableMap<K, V>.() -> V): kotlin.Unit
|
||||
public fun </*0*/ K, /*1*/ V> build2(/*0*/ @kotlin.BuilderInference builderAction: kotlin.collections.MutableMap<K, V>.() -> K): kotlin.Unit
|
||||
public fun </*0*/ K, /*1*/ V> build3(/*0*/ @kotlin.BuilderInference builderAction: kotlin.collections.MutableMap<K, V>.(K) -> kotlin.Unit): kotlin.Unit
|
||||
public fun </*0*/ K, /*1*/ V> build4(/*0*/ @kotlin.BuilderInference builderAction: kotlin.collections.MutableMap<K, V>.() -> kotlin.collections.MutableMap<kotlin.String, kotlin.Int>): kotlin.Unit
|
||||
public fun </*0*/ K : V, /*1*/ V : kotlin.CharSequence> build5(/*0*/ @kotlin.BuilderInference builderAction: kotlin.collections.MutableMap<K, V>.() -> kotlin.collections.MutableMap<kotlin.String, V>): kotlin.Unit
|
||||
public fun </*0*/ K : V, /*1*/ V : kotlin.CharSequence> build6(/*0*/ @kotlin.BuilderInference builderAction: kotlin.collections.MutableMap<K, V>.() -> kotlin.collections.MutableMap<K, kotlin.String>): kotlin.Unit
|
||||
public fun </*0*/ K : V, /*1*/ V : kotlin.CharSequence> build7(/*0*/ @kotlin.BuilderInference builderAction: kotlin.collections.MutableMap<K, V>.() -> kotlin.collections.MutableMap<kotlin.String, V>): kotlin.collections.MutableMap<kotlin.String, V>
|
||||
public fun </*0*/ K> id(/*0*/ x: K): K
|
||||
@kotlin.ExperimentalStdlibApi public fun main(): kotlin.Unit
|
||||
public fun take(/*0*/ x: kotlin.String): kotlin.Unit
|
||||
public fun kotlin.collections.MutableMap<kotlin.String, kotlin.Int>.foo(): kotlin.Unit
|
||||
|
||||
compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.kt
Vendored
+9
-9
@@ -38,7 +38,7 @@ fun <R> select(vararg x: R) = x[0]
|
||||
|
||||
fun poll0(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar, ::foo)
|
||||
val inv = select(<!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>bar<!><!>, <!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>foo<!><!>)
|
||||
inv()
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ fun poll01(): Flow<String> {
|
||||
|
||||
fun poll02(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar3, ::foo3)
|
||||
val inv = select(<!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>bar3<!><!>, <!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>foo3<!><!>)
|
||||
inv()
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ fun poll03(): Flow<String> {
|
||||
|
||||
fun poll04(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar5, ::foo5)
|
||||
val inv = select(<!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>bar5<!><!>, <!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>foo5<!><!>)
|
||||
inv
|
||||
}
|
||||
}
|
||||
@@ -143,7 +143,7 @@ fun poll17(flag: Boolean): Flow<String> {
|
||||
|
||||
fun poll2(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar else -> ::foo }
|
||||
val inv = when (flag) { true -> <!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>bar<!><!> else -> <!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>foo<!><!> }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
@@ -157,7 +157,7 @@ fun poll21(flag: Boolean): Flow<String> {
|
||||
|
||||
fun poll22(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar3 else -> ::foo3 }
|
||||
val inv = when (flag) { true -> <!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>bar3<!><!> else -> <!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>foo3<!><!> }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
@@ -171,7 +171,7 @@ fun poll23(flag: Boolean): Flow<String> {
|
||||
|
||||
fun poll24(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar5 else -> ::foo5 }
|
||||
val inv = when (flag) { true -> <!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>bar5<!><!> else -> <!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>foo5<!><!> }
|
||||
inv
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,7 @@ fun poll26(flag: Boolean): Flow<String> {
|
||||
|
||||
fun poll3(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar false -> ::foo }
|
||||
val inv = when (flag) { true -> <!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>bar<!><!> false -> <!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>foo<!><!> }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
@@ -206,7 +206,7 @@ fun poll31(flag: Boolean): Flow<String> {
|
||||
|
||||
fun poll32(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar3 false -> ::foo3 }
|
||||
val inv = when (flag) { true -> <!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>bar3<!><!> false -> <!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>foo3<!><!> }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
@@ -220,7 +220,7 @@ fun poll33(flag: Boolean): Flow<String> {
|
||||
|
||||
fun poll34(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar5 false -> ::foo5 }
|
||||
val inv = when (flag) { true -> <!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>bar5<!><!> false -> <!TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>foo5<!><!> }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// WITH_RUNTIME
|
||||
// SKIP_TXT
|
||||
// !DIAGNOSTICS: -CAST_NEVER_SUCCEEDS -UNCHECKED_CAST -UNUSED_PARAMETER -UNUSED_VARIABLE -EXPERIMENTAL_API_USAGE_ERROR -UNUSED_EXPRESSION
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
fun <K> FlowCollector<K>.bar(): K = null as K
|
||||
fun <K> FlowCollector<K>.foo(): K = null as K
|
||||
|
||||
fun <K> K.bar3(): K = null as K
|
||||
fun <K> K.foo3(): K = null as K
|
||||
|
||||
fun bar2(): Int = 1
|
||||
fun foo2(): Float = 1f
|
||||
|
||||
val bar4: Int
|
||||
get() = 1
|
||||
|
||||
var foo4: Float
|
||||
get() = 1f
|
||||
set(value) {}
|
||||
|
||||
val <K> FlowCollector<K>.bar5: K get() = null as K
|
||||
val <K> FlowCollector<K>.foo5: K get() = null as K
|
||||
|
||||
class Foo6
|
||||
|
||||
class Foo7<T>
|
||||
fun foo7() = null as Foo7<Int>
|
||||
|
||||
interface FlowCollector<in T> {}
|
||||
|
||||
fun <L> flow(@BuilderInference block: suspend FlowCollector<L>.() -> Unit) = Flow(block)
|
||||
|
||||
class Flow<out R>(private val block: suspend FlowCollector<R>.() -> Unit)
|
||||
|
||||
|
||||
fun poll7(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar!!
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll71(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar2!!
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll72(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar3!!
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll73(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar4!!
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll74(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar5!!
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll75(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo6!!
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll76(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo7!!
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// WITH_RUNTIME
|
||||
// SKIP_TXT
|
||||
// !DIAGNOSTICS: -CAST_NEVER_SUCCEEDS -UNCHECKED_CAST -UNUSED_PARAMETER -UNUSED_VARIABLE -EXPERIMENTAL_API_USAGE_ERROR -UNUSED_EXPRESSION
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
fun <K> FlowCollector<K>.bar(): K = null as K
|
||||
fun <K> FlowCollector<K>.foo(): K = null as K
|
||||
|
||||
fun <K> K.bar3(): K = null as K
|
||||
fun <K> K.foo3(): K = null as K
|
||||
|
||||
fun bar2(): Int = 1
|
||||
fun foo2(): Float = 1f
|
||||
|
||||
val bar4: Int
|
||||
get() = 1
|
||||
|
||||
var foo4: Float
|
||||
get() = 1f
|
||||
set(value) {}
|
||||
|
||||
val <K> FlowCollector<K>.bar5: K get() = null as K
|
||||
val <K> FlowCollector<K>.foo5: K get() = null as K
|
||||
|
||||
class Foo6
|
||||
|
||||
class Foo7<T>
|
||||
fun foo7() = null as Foo7<Int>
|
||||
|
||||
interface FlowCollector<in T> {}
|
||||
|
||||
fun <L> flow(@BuilderInference block: suspend FlowCollector<L>.() -> Unit) = Flow(block)
|
||||
|
||||
class Flow<out R>(private val block: suspend FlowCollector<R>.() -> Unit)
|
||||
|
||||
|
||||
fun poll7(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll71(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar2<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll72(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar3<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll73(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar4<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll74(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar5<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll75(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo6<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll76(): Flow<String> {
|
||||
return flow {
|
||||
val inv = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo7<!><!><!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
|
||||
}
|
||||
}
|
||||
|
||||
+500
@@ -0,0 +1,500 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// WITH_RUNTIME
|
||||
// SKIP_TXT
|
||||
// !DIAGNOSTICS: -CAST_NEVER_SUCCEEDS -UNCHECKED_CAST -UNUSED_PARAMETER -UNUSED_VARIABLE -EXPERIMENTAL_API_USAGE_ERROR -UNUSED_EXPRESSION
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
fun <K> FlowCollector<K>.bar(): K = null as K
|
||||
fun <K> FlowCollector<K>.foo(): K = null as K
|
||||
|
||||
fun <K> K.bar3(): K = null as K
|
||||
fun <K> K.foo3(): K = null as K
|
||||
|
||||
fun bar2(): Int = 1
|
||||
fun foo2(): Float = 1f
|
||||
|
||||
val bar4: Int
|
||||
get() = 1
|
||||
|
||||
var foo4: Float
|
||||
get() = 1f
|
||||
set(value) {}
|
||||
|
||||
val <K> FlowCollector<K>.bar5: K get() = null as K
|
||||
val <K> FlowCollector<K>.foo5: K get() = null as K
|
||||
|
||||
class Foo6
|
||||
|
||||
class Foo7<T>
|
||||
fun foo7() = null as Foo7<Int>
|
||||
|
||||
interface FlowCollector<in T> {}
|
||||
|
||||
fun <L> flow(@BuilderInference block: suspend FlowCollector<L>.() -> Unit): Flow<L> = Flow(block)
|
||||
|
||||
class Flow<out R>(private val block: suspend FlowCollector<R>.() -> Unit)
|
||||
|
||||
fun <R> select(vararg x: R) = x[0]
|
||||
|
||||
fun poll0(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar, ::foo)
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll01(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar2, ::foo2)
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll02(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar3, ::foo3)
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll03(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar4, ::foo4)
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll04(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar5, ::foo5)
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll05(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::Foo6, ::Foo6)
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll06(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(foo7(), ::Foo7)
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll1(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar2 } else { ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll11(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar2 } else { ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll12(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar3 } else { ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll13(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar2 } else { ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll14(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar4 } else { ::foo4 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll15(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar5 } else { ::foo5 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll16(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::Foo6 } else { ::Foo6 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll17(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { foo7() } else { ::Foo7 }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll2(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar else -> ::foo }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll21(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar2 else -> ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll22(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar3 else -> ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll23(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar4 else -> ::foo4 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll24(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar5 else -> ::foo5 }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll25(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::Foo6 else -> ::Foo6 }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll26(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::Foo7 false -> foo7() else -> ::Foo7 }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll3(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar false -> ::foo }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll31(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar2 false -> ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll32(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar3 false -> ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll33(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar4 false -> ::foo4 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll34(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar5 false -> ::foo5 }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll35(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::Foo6 false -> ::Foo6 }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll36(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::Foo7 false -> foo7() }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll4(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar } finally { ::foo }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll41(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar2 } finally { ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll42(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar3 } finally { ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll43(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar4 } finally { ::foo4 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll44(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar5 } finally { ::foo5 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll45(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::Foo6 } finally { ::Foo6 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll46(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { foo7() } finally { ::Foo7 }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll5(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar } catch (e: Exception) { ::foo } finally { ::foo }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll51(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar2 } catch (e: Exception) { ::foo2 } finally { ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll52(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar3 } catch (e: Exception) { ::foo3 } finally { ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll53(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar4 } catch (e: Exception) { ::foo4 } finally { ::foo4 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll54(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar5 } catch (e: Exception) { ::foo5 } finally { ::foo5 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll55(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::Foo6 } catch (e: Exception) { ::Foo6 } finally { ::Foo6 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll56(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::Foo7 } catch (e: Exception) { foo7() } finally { foo7() }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll6(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll61(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar2
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll62(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar3
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll63(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar4
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll64(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar5
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll65(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo6
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll66(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo7
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll7(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar!!
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll71(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar2!!
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll72(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar3!!
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll73(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar4!!
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll74(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar5!!
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll75(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo6!!
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll76(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo7!!
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll8(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar in setOf(::foo)
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll81(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar2 in setOf(::foo2)
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll82(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar3 in setOf(::foo3)
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll83(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar4 in setOf(::foo4)
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll84(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar5 in setOf(::foo5)
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll85(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo6 in setOf(::Foo6)
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll86(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo7 in setOf(::Foo7)
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll87(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo7 in setOf(foo7())
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll88(): Flow<String> {
|
||||
return flow {
|
||||
val inv = foo7() in setOf(::Foo7)
|
||||
inv
|
||||
}
|
||||
}
|
||||
+500
@@ -0,0 +1,500 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// WITH_RUNTIME
|
||||
// SKIP_TXT
|
||||
// !DIAGNOSTICS: -CAST_NEVER_SUCCEEDS -UNCHECKED_CAST -UNUSED_PARAMETER -UNUSED_VARIABLE -EXPERIMENTAL_API_USAGE_ERROR -UNUSED_EXPRESSION
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
fun <K> FlowCollector<K>.bar(): K = null as K
|
||||
fun <K> FlowCollector<K>.foo(): K = null as K
|
||||
|
||||
fun <K> K.bar3(): K = null as K
|
||||
fun <K> K.foo3(): K = null as K
|
||||
|
||||
fun bar2(): Int = 1
|
||||
fun foo2(): Float = 1f
|
||||
|
||||
val bar4: Int
|
||||
get() = 1
|
||||
|
||||
var foo4: Float
|
||||
get() = 1f
|
||||
set(value) {}
|
||||
|
||||
val <K> FlowCollector<K>.bar5: K get() = null as K
|
||||
val <K> FlowCollector<K>.foo5: K get() = null as K
|
||||
|
||||
class Foo6
|
||||
|
||||
class Foo7<T>
|
||||
fun foo7() = null as Foo7<Int>
|
||||
|
||||
interface FlowCollector<in T> {}
|
||||
|
||||
fun <L> flow(@BuilderInference block: suspend FlowCollector<L>.() -> Unit): Flow<L> = Flow(block)
|
||||
|
||||
class Flow<out R>(private val block: suspend FlowCollector<R>.() -> Unit)
|
||||
|
||||
fun <R> select(vararg x: R) = x[0]
|
||||
|
||||
fun poll0(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar, ::foo)
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll01(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar2, ::foo2)
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll02(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar3, ::foo3)
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll03(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar4, ::foo4)
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll04(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar5, ::foo5)
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll05(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::Foo6, ::Foo6)
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll06(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(foo7(), <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::Foo7<!>)
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll1(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar2 } else { ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll11(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar2 } else { ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll12(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar3 } else { ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll13(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar2 } else { ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll14(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar4 } else { ::foo4 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll15(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::bar5 } else { ::foo5 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll16(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { ::Foo6 } else { ::Foo6 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll17(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { foo7() } else { <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::Foo7<!> }
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
|
||||
}
|
||||
}
|
||||
|
||||
fun poll2(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar else -> ::foo }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll21(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar2 else -> ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll22(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar3 else -> ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll23(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar4 else -> ::foo4 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll24(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar5 else -> ::foo5 }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll25(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::Foo6 else -> ::Foo6 }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll26(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> <!IMPLICIT_CAST_TO_ANY, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::Foo7<!> false -> <!IMPLICIT_CAST_TO_ANY!>foo7()<!> <!REDUNDANT_ELSE_IN_WHEN!>else<!> -> <!IMPLICIT_CAST_TO_ANY, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::Foo7<!> }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll3(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar false -> ::foo }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll31(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar2 false -> ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll32(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar3 false -> ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll33(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar4 false -> ::foo4 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll34(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar5 false -> ::foo5 }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll35(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::Foo6 false -> ::Foo6 }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll36(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> <!IMPLICIT_CAST_TO_ANY, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::Foo7<!> false -> <!IMPLICIT_CAST_TO_ANY!>foo7()<!> }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll4(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar } finally { ::foo }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll41(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar2 } finally { ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll42(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar3 } finally { ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll43(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar4 } finally { ::foo4 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll44(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar5 } finally { ::foo5 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll45(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::Foo6 } finally { ::Foo6 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll46(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { foo7() } finally { ::<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo7<!> }
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll5(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar } catch (e: Exception) { ::foo } finally { ::foo }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll51(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar2 } catch (e: Exception) { ::foo2 } finally { ::foo2 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll52(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar3 } catch (e: Exception) { ::foo3 } finally { ::foo3 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll53(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar4 } catch (e: Exception) { ::foo4 } finally { ::foo4 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll54(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::bar5 } catch (e: Exception) { ::foo5 } finally { ::foo5 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll55(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { ::Foo6 } catch (e: Exception) { ::Foo6 } finally { ::Foo6 }
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll56(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::Foo7<!> } catch (e: Exception) { foo7() } finally { foo7() }
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
|
||||
}
|
||||
}
|
||||
|
||||
fun poll6(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll61(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar2
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll62(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar3
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll63(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar4
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll64(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar5
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll65(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo6
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll66(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo7<!>
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
|
||||
}
|
||||
}
|
||||
|
||||
fun poll7(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll71(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar2<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll72(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar3<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll73(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar4<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll74(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar5<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll75(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo6<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll76(): Flow<String> {
|
||||
return flow {
|
||||
val inv = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo7<!><!><!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
|
||||
}
|
||||
}
|
||||
|
||||
fun poll8(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar in setOf(::foo)
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>inv<!>()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll81(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar2 <!TYPE_INFERENCE_ONLY_INPUT_TYPES!>in<!> setOf(::foo2)
|
||||
<!DEBUG_INFO_MISSING_UNRESOLVED!>inv()<!>
|
||||
}
|
||||
}
|
||||
|
||||
fun poll82(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar3 in setOf(::foo3)
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>inv<!>()
|
||||
}
|
||||
}
|
||||
|
||||
fun poll83(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar4 <!TYPE_INFERENCE_ONLY_INPUT_TYPES!>in<!> setOf(::foo4)
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
|
||||
}
|
||||
}
|
||||
|
||||
fun poll84(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar5 in setOf(::foo5)
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll85(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo6 in setOf(::Foo6)
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
fun poll86(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo7<!> in <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>setOf<!>(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::Foo7<!>)
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
|
||||
}
|
||||
}
|
||||
|
||||
fun poll87(): Flow<String> {
|
||||
return flow {
|
||||
val inv = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo7<!><!> <!TYPE_INFERENCE_ONLY_INPUT_TYPES!>in<!> setOf(foo7())
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
|
||||
}
|
||||
}
|
||||
|
||||
fun poll88(): Flow<String> {
|
||||
return flow {
|
||||
val inv = foo7() in <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>setOf<!>(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::Foo7<!>)
|
||||
inv
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -28,12 +28,12 @@ fun <K> capture(x: Inv<K>): K = null as K
|
||||
fun main() {
|
||||
build {
|
||||
emit("")
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<TypeVariable(R)>")!>getInv()<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)")!>captureOut(<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>")!>getInv()<!>)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)")!>captureIn(<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>")!>getInv()<!>)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>")!>getInv()<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>captureOut(<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>")!>getInv()<!>)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>captureIn(<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>")!>getInv()<!>)<!>
|
||||
|
||||
// K is fixed into CapturedType(out NotFixed: TypeVariable(R))
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)")!>capture(<!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.String>")!>getOut()<!>)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>capture(<!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.String>")!>getOut()<!>)<!>
|
||||
""
|
||||
}
|
||||
build {
|
||||
|
||||
Vendored
+9
-9
@@ -33,15 +33,15 @@ fun test() {
|
||||
emit("1")
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(TypeVariable(R)..TypeVariable(R)?)")!>Test.foo(get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(Inv<TypeVariable(R)>..Inv<TypeVariable(R)>?)")!>Test.foo(getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)")!>id(get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)")!>select(get(), get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(TypeVariable(R)..TypeVariable(R)?)")!>select(Test.foo(get()), Test.foo(get()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(TypeVariable(R)..TypeVariable(R)?)")!>select(Test.foo(get()), get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<TypeVariable(R)>")!>select(getInv(), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(Inv<TypeVariable(R)>..Inv<TypeVariable(R)>?)")!>select(Test.foo(getInv()), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(Inv<TypeVariable(R)>..Inv<TypeVariable(R)>?)")!>select(Test.foo(getInv()), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(Inv<TypeVariable(R)>..Inv<TypeVariable(R)>?)")!>select(getInv(), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)")!>select(id(get()), id(get()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>id(get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select(get(), get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(kotlin.String..kotlin.String?)")!>select(Test.foo(get()), Test.foo(get()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(kotlin.String..kotlin.String?)")!>select(Test.foo(get()), get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>")!>select(getInv(), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(Inv<kotlin.String>..Inv<kotlin.String>?)")!>select(Test.foo(getInv()), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(Inv<kotlin.String>..Inv<kotlin.String>?)")!>select(Test.foo(getInv()), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(Inv<kotlin.String>..Inv<kotlin.String>?)")!>select(getInv(), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select(id(get()), id(get()))<!>
|
||||
build2 {
|
||||
emit(1)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select(this@build.get(), get())<!>
|
||||
|
||||
compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeCovariant.kt
Vendored
+17
-17
@@ -34,24 +34,24 @@ fun <E> select4(x: E?, y: Out<E>): E = x!!
|
||||
fun test() {
|
||||
val ret = build {
|
||||
emit("1")
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)?")!>select1(get(), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)?")!>select1(get(), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)?")!>select1(Test.foo(get()), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)?")!>select1(Test.foo(get()), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select2(get(), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select2(get(), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(TypeVariable(R1)..TypeVariable(R1)?)")!>select2(Test.foo(get()), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(TypeVariable(R1)..TypeVariable(R1)?)")!>select2(Test.foo(get()), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select3(get(), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select3(get(), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select3(Test.foo(get()), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select3(Test.foo(get()), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select4(get(), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select4(get(), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select4(Test.foo(get()), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select4(Test.foo(get()), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select1(get(), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select1(get(), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select1(Test.foo(get()), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select1(Test.foo(get()), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select2(get(), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select2(get(), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(kotlin.String..kotlin.String?)")!>select2(Test.foo(get()), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(kotlin.String..kotlin.String?)")!>select2(Test.foo(get()), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select3(get(), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select3(get(), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select3(Test.foo(get()), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select3(Test.foo(get()), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select4(get(), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select4(get(), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select4(Test.foo(get()), Test.foo(getOut()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select4(Test.foo(get()), getOut())<!>
|
||||
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select4(id(Test.foo(get())), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select4(id(Test.foo(get())), getOut())<!>
|
||||
|
||||
build2 {
|
||||
emit(1)
|
||||
|
||||
+3
@@ -66,6 +66,9 @@ fun test() {
|
||||
emit(if (true) "1" else null)
|
||||
select2(get(), getInv())
|
||||
select2(get(), Test.foo(getInv()))
|
||||
getInv()
|
||||
Test.foo(getInv())
|
||||
Test.foo(get())
|
||||
select2(Test.foo(get()), Test.foo(getInv()))
|
||||
select2(Test.foo(get()), getInv())
|
||||
select3(get(), getInv())
|
||||
|
||||
compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeInvariant.kt
Vendored
+31
-28
@@ -34,29 +34,29 @@ fun <E> select4(x: E?, y: Inv<E>): E = x!!
|
||||
fun test() {
|
||||
val ret1 = build {
|
||||
emit("1")
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)?")!>select1(get(), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)?")!>select1(get(), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)?")!>select1(Test.foo(get()), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)?")!>select1(Test.foo(get()), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select4(get(), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select4(get(), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select4(Test.foo(get()), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select4(Test.foo(get()), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select1(get(), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select1(get(), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select1(Test.foo(get()), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select1(Test.foo(get()), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select4(get(), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select4(get(), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select4(Test.foo(get()), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select4(Test.foo(get()), getInv())<!>
|
||||
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select4(id(Test.foo(get())), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select4(id(Test.foo(get())), getInv())<!>
|
||||
|
||||
build2 {
|
||||
emit(1)
|
||||
select1(this@build.get(), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)")!>getInv()<!>)
|
||||
select1(get(), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)")!>Test.foo(this@build.getInv())<!>)
|
||||
select1(Test.foo(this@build.get()), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)!")!>Test.foo(getInv())<!>)
|
||||
select1(Test.foo(get()), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)!")!>this@build.getInv()<!>)
|
||||
select4(this@build.get(), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)")!>getInv()<!>)
|
||||
select4(get(), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)")!>Test.foo(this@build.getInv())<!>)
|
||||
select4(Test.foo(this@build.get()), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)")!>Test.foo(getInv())<!>)
|
||||
select4(Test.foo(get()), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)")!>this@build.getInv()<!>)
|
||||
select1(this@build.get(), <!TYPE_MISMATCH!>getInv()<!>)
|
||||
select1(get(), <!TYPE_MISMATCH!>Test.foo(this@build.getInv())<!>)
|
||||
select1(Test.foo(this@build.get()), <!TYPE_MISMATCH!>Test.foo(getInv())<!>)
|
||||
select1(Test.foo(get()), <!TYPE_MISMATCH!>this@build.getInv()<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(kotlin.Int..kotlin.Int?)")!>select4(this@build.get(), <!TYPE_MISMATCH!>getInv()<!>)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select4(get(), <!TYPE_MISMATCH!>Test.foo(this@build.getInv())<!>)<!>
|
||||
select4(Test.foo(this@build.get()), <!TYPE_MISMATCH!>Test.foo(getInv())<!>)
|
||||
select4(Test.foo(get()), <!TYPE_MISMATCH!>this@build.getInv()<!>)
|
||||
|
||||
select4(id(Test.foo(this@build.get())), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)")!>getInv()<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(kotlin.Int..kotlin.Int?)")!>select4(id(Test.foo(this@build.get())), <!TYPE_MISMATCH!>getInv()<!>)<!>
|
||||
""
|
||||
}
|
||||
""
|
||||
@@ -64,14 +64,17 @@ fun test() {
|
||||
|
||||
val ret2 = build {
|
||||
emit(if (true) "1" else null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select2(get(), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select2(get(), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select2(Test.foo(get()), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select2(Test.foo(get()), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select3(get(), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select3(get(), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select3(Test.foo(get()), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>select3(Test.foo(get()), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select2(get(), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select2(get(), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String?>")!>getInv()<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(Inv<TypeVariable(R1)>..Inv<TypeVariable(R1)>?)")!>Test.foo(<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String?>")!>getInv()<!>)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(TypeVariable(R1)..TypeVariable(R1)?)")!>Test.foo(get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select2(Test.foo(get()), <!DEBUG_INFO_EXPRESSION_TYPE("(Inv<kotlin.String?>..Inv<kotlin.String?>?)")!>Test.foo(<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String?>")!>getInv()<!>)<!>)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select2(Test.foo(get()), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select3(get(), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select3(get(), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select3(Test.foo(get()), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select3(Test.foo(get()), getInv())<!>
|
||||
|
||||
build2 {
|
||||
emit(1)
|
||||
@@ -79,8 +82,8 @@ fun test() {
|
||||
select2(get(), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)")!>Test.foo(this@build.getInv())<!>)
|
||||
select2(Test.foo(this@build.get()), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)!")!>Test.foo(getInv())<!>)
|
||||
select2(Test.foo(get()), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)!")!>this@build.getInv()<!>)
|
||||
select3(this@build.get(), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)")!>getInv()<!>)
|
||||
select3(get(), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)")!>Test.foo(this@build.getInv())<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select3(this@build.get(), <!TYPE_MISMATCH!>getInv()<!>)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select3(get(), <!TYPE_MISMATCH!>Test.foo(this@build.getInv())<!>)<!>
|
||||
select3(Test.foo(this@build.get()), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)")!>Test.foo(getInv())<!>)
|
||||
select3(Test.foo(get()), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)")!>this@build.getInv()<!>)
|
||||
""
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
// FILE: Test.java
|
||||
|
||||
import org.jetbrains.annotations.*
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
class Test {
|
||||
@Nullable
|
||||
|
||||
Vendored
+18
-18
@@ -4,7 +4,7 @@
|
||||
|
||||
// FILE: Test.java
|
||||
|
||||
import org.jetbrains.annotations.*
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
class Test {
|
||||
@Nullable
|
||||
@@ -36,15 +36,15 @@ fun test() {
|
||||
emit("1")
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)?")!>Test.foo(get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<TypeVariable(R)>?")!>Test.foo(getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)?")!>id(get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)?")!>select(get(), get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)?")!>select(Test.foo(get()), Test.foo(get()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)?")!>select(Test.foo(get()), get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<TypeVariable(R)>?")!>select(getInv(), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<TypeVariable(R)>?")!>select(Test.foo(getInv()), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<TypeVariable(R)>?")!>select(Test.foo(getInv()), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<TypeVariable(R)>?")!>select(getInv(), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)?")!>select(id(get()), id(get()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>id(get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select(get(), get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select(Test.foo(get()), Test.foo(get()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select(Test.foo(get()), get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>?")!>select(getInv(), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>?")!>select(Test.foo(getInv()), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>?")!>select(Test.foo(getInv()), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>?")!>select(getInv(), Test.foo(getInv()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select(id(get()), id(get()))<!>
|
||||
build2 {
|
||||
emit(1)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select(this@build.get(), get())<!>
|
||||
@@ -59,14 +59,14 @@ fun test() {
|
||||
}
|
||||
val ret2 = build {
|
||||
emit("1")
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)?")!>select(get(), null)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)?")!>select(Test.<!IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION!>foo<!>(null), Test.foo(get()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)?")!>select(Test.foo(get()), null)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<TypeVariable(R)>?")!>select(null, getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<TypeVariable(R)>?")!>select(Test.foo(getInv()), Test.<!IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION!>foo<!>(null))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<TypeVariable(R)>?")!>select(Test.<!IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION!>foo<!>(null), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<TypeVariable(R)>?")!>select(getInv(), Test.<!IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION!>foo<!>(null))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)?")!>select(<!IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION!>id<!>(null), id(get()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select(get(), null)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select(Test.<!IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION!>foo<!>(null), Test.foo(get()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select(Test.foo(get()), null)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>?")!>select(null, getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>?")!>select(Test.foo(getInv()), Test.<!IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION!>foo<!>(null))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>?")!>select(Test.<!IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION!>foo<!>(null), getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>?")!>select(getInv(), Test.<!IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION!>foo<!>(null))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select(<!IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION!>id<!>(null), id(get()))<!>
|
||||
build2 {
|
||||
emit(1)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select(this@build.get(), get(), null)<!>
|
||||
|
||||
+8
-8
@@ -31,17 +31,17 @@ fun <E> intersect(vararg x: In<E>): E = null as E
|
||||
fun test() {
|
||||
val ret = build {
|
||||
emit("1")
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>intersect(getIn(), getIn())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>intersect(getIn(), Test.foo(getIn()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>intersect(Test.foo(getIn()), Test.foo(getIn()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R1)")!>intersect(Test.foo(getIn()), getIn())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>intersect(getIn(), getIn())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>intersect(getIn(), Test.foo(getIn()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>intersect(Test.foo(getIn()), Test.foo(getIn()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>intersect(Test.foo(getIn()), getIn())<!>
|
||||
|
||||
build2 {
|
||||
emit(1)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("{TypeVariable(R1) & TypeVariable(R2)}")!>intersect(this@build.getIn(), getIn())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("{TypeVariable(R1) & TypeVariable(R2)}")!>intersect(getIn(), Test.foo(this@build.getIn()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("{TypeVariable(R1) & TypeVariable(R2)}")!>intersect(Test.foo(this@build.getIn()), Test.foo(getIn()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("{TypeVariable(R1) & TypeVariable(R2)}")!>intersect(Test.foo(getIn()), this@build.getIn())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("{Int & String}")!>intersect(this@build.getIn(), getIn())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("{Int & String}")!>intersect(getIn(), Test.foo(this@build.getIn()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("{Int & String}")!>intersect(Test.foo(this@build.getIn()), Test.foo(getIn()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("{Int & String}")!>intersect(Test.foo(getIn()), this@build.getIn())<!>
|
||||
""
|
||||
}
|
||||
""
|
||||
|
||||
Vendored
+68
-2
@@ -17,7 +17,7 @@ fun Any.test() {}
|
||||
fun Any?.test2() {}
|
||||
|
||||
fun test() {
|
||||
val ret = build {
|
||||
val ret1 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
get()?.test()
|
||||
@@ -27,10 +27,31 @@ fun test() {
|
||||
get()?.equals(1)
|
||||
// there is `String?.equals` extension
|
||||
get().equals("")
|
||||
}
|
||||
val ret2 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
get()?.test()
|
||||
get()?.test2()
|
||||
get().test2()
|
||||
get()?.hashCode()
|
||||
get()?.equals(1)
|
||||
val x = get()
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
x.equals("")
|
||||
}
|
||||
val ret3 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
get()?.test()
|
||||
get()?.test2()
|
||||
get().test2()
|
||||
get()?.hashCode()
|
||||
get()?.equals(1)
|
||||
val x = get()
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
|
||||
if (get() == null) {}
|
||||
if (get() === null) {}
|
||||
@@ -46,10 +67,27 @@ fun test() {
|
||||
x.test2()
|
||||
}
|
||||
|
||||
""
|
||||
}
|
||||
val ret4 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
get()?.test()
|
||||
get()?.test2()
|
||||
get().test2()
|
||||
get()?.hashCode()
|
||||
get()?.equals(1)
|
||||
val x = get()
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
|
||||
if (get() == null) {}
|
||||
if (get() === null) {}
|
||||
|
||||
if (x == null) {
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
x.equals("")
|
||||
x.equals("") // TODO: is it correct?
|
||||
x.hashCode()
|
||||
x.toString()
|
||||
x.test()
|
||||
@@ -68,6 +106,34 @@ fun test() {
|
||||
x.test2()
|
||||
}
|
||||
|
||||
""
|
||||
}
|
||||
val ret5 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
get()?.test()
|
||||
get()?.test2()
|
||||
get().test2()
|
||||
get()?.hashCode()
|
||||
get()?.equals(1)
|
||||
val x = get()
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
|
||||
if (get() == null) {}
|
||||
if (get() === null) {}
|
||||
|
||||
if (x == null) {
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
x.equals("")
|
||||
x.hashCode()
|
||||
x.toString()
|
||||
x.test()
|
||||
x?.test2()
|
||||
x.test2()
|
||||
}
|
||||
|
||||
""
|
||||
}
|
||||
}
|
||||
+76
-10
@@ -17,7 +17,7 @@ fun Any.test() {}
|
||||
fun Any?.test2() {}
|
||||
|
||||
fun test() {
|
||||
val ret = build {
|
||||
val ret1 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
get()?.test()
|
||||
@@ -26,11 +26,32 @@ fun test() {
|
||||
get()?.hashCode()
|
||||
get()?.equals(1)
|
||||
// there is `String?.equals` extension
|
||||
<!TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>get()<!>.equals("")
|
||||
<!TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>get()<!>.equals("")
|
||||
}
|
||||
val ret2 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
get()?.test()
|
||||
get()?.test2()
|
||||
get().test2()
|
||||
get()?.hashCode()
|
||||
get()?.equals(1)
|
||||
val x = get()
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
x<!UNSAFE_CALL!>.<!>equals("")
|
||||
}
|
||||
val ret3 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
get()?.test()
|
||||
get()?.test2()
|
||||
get().test2()
|
||||
get()?.hashCode()
|
||||
get()?.equals(1)
|
||||
val x = get()
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
x.equals("")
|
||||
|
||||
if (get() == null) {}
|
||||
if (get() === null) {}
|
||||
@@ -38,21 +59,38 @@ fun test() {
|
||||
if (x != null) {
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!>equals(1)
|
||||
x.equals("")
|
||||
x.hashCode()
|
||||
x.toString()
|
||||
x.test()
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.equals("")
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.hashCode()
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.toString()
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.test()
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!>test2()
|
||||
x.test2()
|
||||
}
|
||||
|
||||
""
|
||||
}
|
||||
val ret4 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
get()?.test()
|
||||
get()?.test2()
|
||||
get().test2()
|
||||
get()?.hashCode()
|
||||
get()?.equals(1)
|
||||
val x = get()
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
|
||||
if (get() == null) {}
|
||||
if (get() === null) {}
|
||||
|
||||
if (x == null) {
|
||||
<!DEBUG_INFO_CONSTANT!>x<!>?.hashCode()
|
||||
<!DEBUG_INFO_CONSTANT!>x<!>?.equals(1)
|
||||
x.equals("")
|
||||
x.equals("") // TODO: is it correct?
|
||||
x.hashCode()
|
||||
x.toString()
|
||||
x.test()
|
||||
x<!UNSAFE_CALL!>.<!>test()
|
||||
<!DEBUG_INFO_CONSTANT!>x<!>?.test2()
|
||||
x.test2()
|
||||
}
|
||||
@@ -63,7 +101,35 @@ fun test() {
|
||||
x.equals("")
|
||||
x.hashCode()
|
||||
x.toString()
|
||||
x.test()
|
||||
x<!UNSAFE_CALL!>.<!>test()
|
||||
<!DEBUG_INFO_CONSTANT!>x<!>?.test2()
|
||||
x.test2()
|
||||
}
|
||||
|
||||
""
|
||||
}
|
||||
val ret5 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
get()?.test()
|
||||
get()?.test2()
|
||||
get().test2()
|
||||
get()?.hashCode()
|
||||
get()?.equals(1)
|
||||
val x = get()
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
|
||||
if (get() == null) {}
|
||||
if (get() === null) {}
|
||||
|
||||
if (x == null) {
|
||||
<!DEBUG_INFO_CONSTANT!>x<!>?.hashCode()
|
||||
<!DEBUG_INFO_CONSTANT!>x<!>?.equals(1)
|
||||
x.equals("")
|
||||
x.hashCode()
|
||||
x.toString()
|
||||
x<!UNSAFE_CALL!>.<!>test()
|
||||
<!DEBUG_INFO_CONSTANT!>x<!>?.test2()
|
||||
x.test2()
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -22,8 +22,8 @@ fun <U> id(x: U) = x
|
||||
fun test() {
|
||||
val ret = build {
|
||||
emit("1")
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypeVariable(R)")!>get()<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<TypeVariable(R)>")!>getInv()<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>get()<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>")!>getInv()<!>
|
||||
""
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -12,6 +12,6 @@ fun foo(a: Any) {}
|
||||
|
||||
fun test(b: B, c: C) {
|
||||
foo(
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any")!>select(b, c)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("A")!>select(b, c)<!>
|
||||
)
|
||||
}
|
||||
|
||||
compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.kt
Vendored
+1
-1
@@ -22,7 +22,7 @@ fun test(nullableSample: ISample, any: Any) {
|
||||
)
|
||||
|
||||
elvisSimple(
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>elvisExact(nullableSample, materialize())<!>,
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ISample")!>elvisExact(nullableSample, <!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS!>materialize<!>())<!>,
|
||||
any
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// NI_EXPECTED_FILE
|
||||
// See EA-76890 / KT-10843: NPE during analysis
|
||||
fun lambda(x : Int?) = x?.<!FUNCTION_CALL_EXPECTED, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>let<!> <!DEBUG_INFO_MISSING_UNRESOLVED!>l<!> {
|
||||
fun lambda(x : Int?) = x?.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, FUNCTION_CALL_EXPECTED, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>let<!> <!DEBUG_INFO_MISSING_UNRESOLVED!>l<!> {
|
||||
<!CANNOT_INFER_PARAMETER_TYPE!>y<!> ->
|
||||
if (<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>y<!> <!DEBUG_INFO_MISSING_UNRESOLVED!>><!> 0) return<!UNRESOLVED_REFERENCE!>@l<!> x
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>y<!>
|
||||
|
||||
Generated
+12
-6
@@ -12686,12 +12686,24 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesErrorTypeUnrestricted.kt")
|
||||
public void testSpecialCallsWithCallableReferencesErrorTypeUnrestricted() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorTypeUnrestricted.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt")
|
||||
public void testSpecialCallsWithCallableReferencesNonStrictOnlyInputTypes() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesUnrestricted.kt")
|
||||
public void testSpecialCallsWithCallableReferencesUnrestricted() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesUnrestricted.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithLambdas.kt")
|
||||
public void testSpecialCallsWithLambdas() throws Exception {
|
||||
@@ -12712,12 +12724,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
public void testViolating() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/constraints/violating.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("withExpectedType.kt")
|
||||
public void testWithExpectedType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/constraints/withExpectedType.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
+78
@@ -17557,18 +17557,78 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/callableReferencesProperCompletion.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("capturedTypes.kt")
|
||||
public void testCapturedTypes() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/capturedTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("commonSuperType.kt")
|
||||
public void testCommonSuperType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("commonSuperTypeContravariant.kt")
|
||||
public void testCommonSuperTypeContravariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeContravariant.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("commonSuperTypeCovariant.kt")
|
||||
public void testCommonSuperTypeCovariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeCovariant.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("commonSuperTypeInvariant.kt")
|
||||
public void testCommonSuperTypeInvariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeInvariant.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("commonSuperTypeNullable.kt")
|
||||
public void testCommonSuperTypeNullable() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intersect.kt")
|
||||
public void testIntersect() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/intersect.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt41164.kt")
|
||||
public void testKt41164() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt41164.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("labaledCall.kt")
|
||||
public void testLabaledCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/labaledCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lackOfNullCheckOnNullableInsideBuild.kt")
|
||||
public void testLackOfNullCheckOnNullableInsideBuild() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("memberScope.kt")
|
||||
public void testMemberScope() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/memberScope.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullability.kt")
|
||||
public void testNullability() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/nullability.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propagateInferenceSessionIntoDeclarationAnalyzers.kt")
|
||||
public void testPropagateInferenceSessionIntoDeclarationAnalyzers() throws Exception {
|
||||
@@ -17587,6 +17647,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExpression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontCareTypeInBlockExression() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontRewriteAtSlice.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontRewriteAtSlice() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesErrorType.kt")
|
||||
public void testSpecialCallsWithCallableReferencesErrorType() throws Exception {
|
||||
@@ -17652,6 +17724,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
public void testTopDownCompletionWithTwoBuilderInferenceCalls() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithTwoBuilderInferenceCalls.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("withExpectedType.kt")
|
||||
public void testWithExpectedType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/withExpectedType.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+78
@@ -17587,18 +17587,78 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/callableReferencesProperCompletion.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("capturedTypes.kt")
|
||||
public void testCapturedTypes() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/capturedTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("commonSuperType.kt")
|
||||
public void testCommonSuperType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("commonSuperTypeContravariant.kt")
|
||||
public void testCommonSuperTypeContravariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeContravariant.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("commonSuperTypeCovariant.kt")
|
||||
public void testCommonSuperTypeCovariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeCovariant.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("commonSuperTypeInvariant.kt")
|
||||
public void testCommonSuperTypeInvariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeInvariant.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("commonSuperTypeNullable.kt")
|
||||
public void testCommonSuperTypeNullable() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intersect.kt")
|
||||
public void testIntersect() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/intersect.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt41164.kt")
|
||||
public void testKt41164() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt41164.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("labaledCall.kt")
|
||||
public void testLabaledCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/labaledCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lackOfNullCheckOnNullableInsideBuild.kt")
|
||||
public void testLackOfNullCheckOnNullableInsideBuild() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("memberScope.kt")
|
||||
public void testMemberScope() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/memberScope.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullability.kt")
|
||||
public void testNullability() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/nullability.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propagateInferenceSessionIntoDeclarationAnalyzers.kt")
|
||||
public void testPropagateInferenceSessionIntoDeclarationAnalyzers() throws Exception {
|
||||
@@ -17617,6 +17677,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExpression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontCareTypeInBlockExression() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontRewriteAtSlice.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontRewriteAtSlice() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("specialCallsWithCallableReferencesErrorType.kt")
|
||||
public void testSpecialCallsWithCallableReferencesErrorType() throws Exception {
|
||||
@@ -17682,6 +17754,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
public void testTopDownCompletionWithTwoBuilderInferenceCalls() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithTwoBuilderInferenceCalls.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("withExpectedType.kt")
|
||||
public void testWithExpectedType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/withExpectedType.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+65
@@ -14536,16 +14536,66 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/callableReferencesProperCompletion.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("capturedTypes.kt")
|
||||
public void testCapturedTypes() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/capturedTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperType.kt")
|
||||
public void testCommonSuperType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeContravariant.kt")
|
||||
public void testCommonSuperTypeContravariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeContravariant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeCovariant.kt")
|
||||
public void testCommonSuperTypeCovariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeCovariant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeInvariant.kt")
|
||||
public void testCommonSuperTypeInvariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeInvariant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeNullable.kt")
|
||||
public void testCommonSuperTypeNullable() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("intersect.kt")
|
||||
public void testIntersect() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/intersect.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt41164.kt")
|
||||
public void testKt41164() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt41164.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("labaledCall.kt")
|
||||
public void testLabaledCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/labaledCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lackOfNullCheckOnNullableInsideBuild.kt")
|
||||
public void testLackOfNullCheckOnNullableInsideBuild() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("memberScope.kt")
|
||||
public void testMemberScope() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/memberScope.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nullability.kt")
|
||||
public void testNullability() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/nullability.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propagateInferenceSessionIntoDeclarationAnalyzers.kt")
|
||||
public void testPropagateInferenceSessionIntoDeclarationAnalyzers() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/propagateInferenceSessionIntoDeclarationAnalyzers.kt");
|
||||
@@ -14561,6 +14611,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontCareTypeInBlockExression() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontRewriteAtSlice.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontRewriteAtSlice() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("specialCallsWithCallableReferencesErrorType.kt")
|
||||
public void testSpecialCallsWithCallableReferencesErrorType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt");
|
||||
@@ -14615,6 +14675,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
public void testTopDownCompletionWithTwoBuilderInferenceCalls() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithTwoBuilderInferenceCalls.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("withExpectedType.kt")
|
||||
public void testWithExpectedType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/withExpectedType.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+65
@@ -12730,16 +12730,66 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/callableReferencesProperCompletion.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("capturedTypes.kt")
|
||||
public void testCapturedTypes() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/capturedTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperType.kt")
|
||||
public void testCommonSuperType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeContravariant.kt")
|
||||
public void testCommonSuperTypeContravariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeContravariant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeCovariant.kt")
|
||||
public void testCommonSuperTypeCovariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeCovariant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeInvariant.kt")
|
||||
public void testCommonSuperTypeInvariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeInvariant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeNullable.kt")
|
||||
public void testCommonSuperTypeNullable() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("intersect.kt")
|
||||
public void testIntersect() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/intersect.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt41164.kt")
|
||||
public void testKt41164() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt41164.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("labaledCall.kt")
|
||||
public void testLabaledCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/labaledCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lackOfNullCheckOnNullableInsideBuild.kt")
|
||||
public void testLackOfNullCheckOnNullableInsideBuild() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("memberScope.kt")
|
||||
public void testMemberScope() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/memberScope.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nullability.kt")
|
||||
public void testNullability() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/nullability.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propagateInferenceSessionIntoDeclarationAnalyzers.kt")
|
||||
public void testPropagateInferenceSessionIntoDeclarationAnalyzers() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/propagateInferenceSessionIntoDeclarationAnalyzers.kt");
|
||||
@@ -12755,6 +12805,16 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontCareTypeInBlockExression() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontRewriteAtSlice.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontRewriteAtSlice() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("specialCallsWithCallableReferencesErrorType.kt")
|
||||
public void testSpecialCallsWithCallableReferencesErrorType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt");
|
||||
@@ -12804,6 +12864,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
public void testTopDownCompletionWithTwoBuilderInferenceCalls() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithTwoBuilderInferenceCalls.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("withExpectedType.kt")
|
||||
public void testWithExpectedType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/withExpectedType.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Generated
+65
@@ -12136,16 +12136,66 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/callableReferencesProperCompletion.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("capturedTypes.kt")
|
||||
public void testCapturedTypes() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/capturedTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperType.kt")
|
||||
public void testCommonSuperType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeContravariant.kt")
|
||||
public void testCommonSuperTypeContravariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeContravariant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeCovariant.kt")
|
||||
public void testCommonSuperTypeCovariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeCovariant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeInvariant.kt")
|
||||
public void testCommonSuperTypeInvariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeInvariant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeNullable.kt")
|
||||
public void testCommonSuperTypeNullable() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("intersect.kt")
|
||||
public void testIntersect() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/intersect.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt41164.kt")
|
||||
public void testKt41164() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt41164.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("labaledCall.kt")
|
||||
public void testLabaledCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/labaledCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lackOfNullCheckOnNullableInsideBuild.kt")
|
||||
public void testLackOfNullCheckOnNullableInsideBuild() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("memberScope.kt")
|
||||
public void testMemberScope() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/memberScope.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nullability.kt")
|
||||
public void testNullability() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/nullability.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propagateInferenceSessionIntoDeclarationAnalyzers.kt")
|
||||
public void testPropagateInferenceSessionIntoDeclarationAnalyzers() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/propagateInferenceSessionIntoDeclarationAnalyzers.kt");
|
||||
@@ -12161,6 +12211,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontCareTypeInBlockExression() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontRewriteAtSlice.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontRewriteAtSlice() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("specialCallsWithCallableReferencesErrorType.kt")
|
||||
public void testSpecialCallsWithCallableReferencesErrorType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt");
|
||||
@@ -12210,6 +12270,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
public void testTopDownCompletionWithTwoBuilderInferenceCalls() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithTwoBuilderInferenceCalls.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("withExpectedType.kt")
|
||||
public void testWithExpectedType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/withExpectedType.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Generated
+65
@@ -12201,16 +12201,66 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/callableReferencesProperCompletion.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("capturedTypes.kt")
|
||||
public void testCapturedTypes() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/capturedTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperType.kt")
|
||||
public void testCommonSuperType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeContravariant.kt")
|
||||
public void testCommonSuperTypeContravariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeContravariant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeCovariant.kt")
|
||||
public void testCommonSuperTypeCovariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeCovariant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeInvariant.kt")
|
||||
public void testCommonSuperTypeInvariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeInvariant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeNullable.kt")
|
||||
public void testCommonSuperTypeNullable() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("intersect.kt")
|
||||
public void testIntersect() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/intersect.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt41164.kt")
|
||||
public void testKt41164() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt41164.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("labaledCall.kt")
|
||||
public void testLabaledCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/labaledCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lackOfNullCheckOnNullableInsideBuild.kt")
|
||||
public void testLackOfNullCheckOnNullableInsideBuild() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("memberScope.kt")
|
||||
public void testMemberScope() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/memberScope.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nullability.kt")
|
||||
public void testNullability() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/nullability.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propagateInferenceSessionIntoDeclarationAnalyzers.kt")
|
||||
public void testPropagateInferenceSessionIntoDeclarationAnalyzers() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/propagateInferenceSessionIntoDeclarationAnalyzers.kt");
|
||||
@@ -12226,6 +12276,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontCareTypeInBlockExression() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontRewriteAtSlice.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontRewriteAtSlice() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("specialCallsWithCallableReferencesErrorType.kt")
|
||||
public void testSpecialCallsWithCallableReferencesErrorType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt");
|
||||
@@ -12275,6 +12335,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
public void testTopDownCompletionWithTwoBuilderInferenceCalls() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithTwoBuilderInferenceCalls.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("withExpectedType.kt")
|
||||
public void testWithExpectedType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/withExpectedType.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+65
@@ -6491,25 +6491,90 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inference/builderInference"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("capturedTypes.kt")
|
||||
public void testCapturedTypes() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/capturedTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperType.kt")
|
||||
public void testCommonSuperType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeContravariant.kt")
|
||||
public void testCommonSuperTypeContravariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeContravariant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeCovariant.kt")
|
||||
public void testCommonSuperTypeCovariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeCovariant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeInvariant.kt")
|
||||
public void testCommonSuperTypeInvariant() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeInvariant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSuperTypeNullable.kt")
|
||||
public void testCommonSuperTypeNullable() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("intersect.kt")
|
||||
public void testIntersect() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/intersect.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt41164.kt")
|
||||
public void testKt41164() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt41164.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("labaledCall.kt")
|
||||
public void testLabaledCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/labaledCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lackOfNullCheckOnNullableInsideBuild.kt")
|
||||
public void testLackOfNullCheckOnNullableInsideBuild() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("memberScope.kt")
|
||||
public void testMemberScope() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/memberScope.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nullability.kt")
|
||||
public void testNullability() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/nullability.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propagateInferenceSessionIntoDeclarationAnalyzers.kt")
|
||||
public void testPropagateInferenceSessionIntoDeclarationAnalyzers() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/propagateInferenceSessionIntoDeclarationAnalyzers.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontCareTypeInBlockExression() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("specialCallsWithCallableReferencesDontRewriteAtSlice.kt")
|
||||
public void testSpecialCallsWithCallableReferencesDontRewriteAtSlice() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("substituteStubTypeIntolambdaParameterDescriptor.kt")
|
||||
public void testSubstituteStubTypeIntolambdaParameterDescriptor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/substituteStubTypeIntolambdaParameterDescriptor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("withExpectedType.kt")
|
||||
public void testWithExpectedType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/withExpectedType.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user