K2: Adjust test data after PCLA implementation [red-to-green]

^KT-59791 In Progress
This commit is contained in:
Denis.Zharkov
2023-12-13 15:08:19 +01:00
committed by Space Team
parent 8459465177
commit b9019d3de1
74 changed files with 232 additions and 205 deletions
@@ -2,7 +2,7 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val outerBuildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> outerBuild@ {
val outerBuildee = build outerBuild@ {
class LocalClass {
fun localClassMember() {
val innerBuildee = build innerBuild@ {
@@ -17,7 +17,7 @@ fun test() {
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<TargetType><!>>(outerBuildee)
checkExactType<Buildee<TargetType>>(outerBuildee)
}
@@ -2,7 +2,7 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val outerBuildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> outerBuild@ {
val outerBuildee = build outerBuild@ {
object {
fun anonymousObjectMember() {
val innerBuildee = build innerBuild@ {
@@ -17,7 +17,7 @@ fun test() {
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<TargetType><!>>(outerBuildee)
checkExactType<Buildee<TargetType>>(outerBuildee)
}
@@ -2,7 +2,7 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val outerBuildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> outerBuild@ {
val outerBuildee = build outerBuild@ {
fun localFunction() {
val innerBuildee = build innerBuild@ {
this@outerBuild.setTypeVariable(TargetType())
@@ -15,7 +15,7 @@ fun test() {
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<TargetType><!>>(outerBuildee)
checkExactType<Buildee<TargetType>>(outerBuildee)
}
@@ -2,7 +2,7 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val outerBuildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> outerBuild@ {
val outerBuildee = build outerBuild@ {
val innerBuildee = build innerBuild@ {
this@outerBuild.setTypeVariable(TargetType())
this@innerBuild.setTypeVariable(TargetType())
@@ -13,7 +13,7 @@ fun test() {
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<TargetType><!>>(outerBuildee)
checkExactType<Buildee<TargetType>>(outerBuildee)
}
@@ -2,8 +2,8 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val outerBuildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> outerBuild@ {
val middleBuildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> middleBuild@ {
val outerBuildee = build outerBuild@ {
val middleBuildee = build middleBuild@ {
val innerBuildee = build innerBuild@ {
this@outerBuild.setTypeVariable(TargetType())
this@middleBuild.setTypeVariable(TargetType())
@@ -15,11 +15,11 @@ fun test() {
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<TargetType><!>>(middleBuildee)
checkExactType<Buildee<TargetType>>(middleBuildee)
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<TargetType><!>>(outerBuildee)
checkExactType<Buildee<TargetType>>(outerBuildee)
}
@@ -4,7 +4,7 @@
fun test() {
val buildee = build {
setTypeVariable(TargetType())
consume(<!ARGUMENT_TYPE_MISMATCH!>getTypeVariable()<!>)
consume(getTypeVariable())
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
@@ -2,14 +2,14 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
val buildee = build {
this as DerivedBuildee<*>
getTypeVariable()
getTypeVariable()
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<*><!>>(buildee)
checkExactType<Buildee<*>>(<!ARGUMENT_TYPE_MISMATCH!>buildee<!>)
}
@@ -3,8 +3,8 @@
fun test() {
val buildee = initializeAndBuild(
{ build <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ setTypeVariable(TargetType()) }<!> },
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ placeholderExtensionInvokeOnBuildee() }<!>,
{ build { setTypeVariable(TargetType()) } },
{ placeholderExtensionInvokeOnBuildee() },
)
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
@@ -2,12 +2,12 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
val buildee = build {
typeVariableMutableProperty = ""
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<String><!>>(buildee)
checkExactType<Buildee<String>>(buildee)
}
@@ -2,12 +2,12 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
val buildee = build {
typeVariableMutableProperty = 42
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<Int><!>>(buildee)
checkExactType<Buildee<Int>>(buildee)
}
@@ -2,12 +2,12 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
val buildee = build {
typeVariableMutableProperty = {}
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<() -> Unit><!>>(buildee)
checkExactType<Buildee<() -> Unit>>(buildee)
}
@@ -8,7 +8,7 @@ fun test() {
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
checkExactType<Buildee<TargetType>>(<!ARGUMENT_TYPE_MISMATCH!>buildee<!>)
checkExactType<Buildee<TargetType>>(buildee)
}
@@ -11,13 +11,13 @@ fun <ETV> Buildee<ETV>.yieldWithoutAnnotation(value: ETV) {}
fun <ETV> Buildee<ETV>.yieldWithAnnotation(t: ETV) {}
fun test() {
val buildeeA = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
val buildeeA = build {
yieldWithoutAnnotation(materializeBuildee<TargetType>())
yieldWithoutAnnotation(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>materializeBuildee<!>())
yieldWithoutAnnotation(materializeBuildee())
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<Buildee<TargetType>><!>>(buildeeA)
checkExactType<Buildee<Buildee<TargetType>>>(buildeeA)
val buildeeB = build {
yieldWithAnnotation(materializeBuildee<TargetType>())
@@ -2,10 +2,10 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_ERROR!>build {
val buildee = build {
setTypeVariable(TargetType())
extensionSetOutProjectedTypeVariable(DifferentType())
}<!>
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
checkExactType<Buildee<TargetType>>(buildee)
@@ -5,7 +5,7 @@
fun test() {
val buildee = build {
setTypeVariable(Any())
<!OVERLOAD_RESOLUTION_AMBIGUITY!>consumeBuildeeReceiver<!>()
consumeBuildeeReceiver()
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
@@ -4,7 +4,7 @@
fun test() {
val buildee = build {
setTypeVariable(TargetType())
<!OVERLOAD_RESOLUTION_AMBIGUITY!>consume<!>(getTypeVariable())
consume(getTypeVariable())
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
@@ -0,0 +1,29 @@
// ISSUE: KT-60291
// CHECK_TYPE_WITH_EXACT
// WITH_STDLIB
fun test() {
val buildee = selectBuildee(
build { setTypeVariable(TargetType()) },
build {}
)
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
checkExactType<Buildee<TargetType>>(buildee)
}
fun <T> selectBuildee(vararg values: Buildee<T>): Buildee<T> = values.first()
class TargetType
class Buildee<TV> {
fun setTypeVariable(value: TV) { storage = value }
private var storage: TV = null!!
}
fun <PTV> build(instructions: Buildee<PTV>.() -> Unit): Buildee<PTV> {
return Buildee<PTV>().apply(instructions)
}
@@ -1,5 +1,4 @@
// ISSUE: KT-60291
// FIR_IDENTICAL
// CHECK_TYPE_WITH_EXACT
// WITH_STDLIB
@@ -0,0 +1,26 @@
// ISSUE: KT-60291
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = if (true)
build { setTypeVariable(TargetType()) }
else
build {}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
checkExactType<Buildee<TargetType>>(buildee)
}
class TargetType
class Buildee<TV> {
fun setTypeVariable(value: TV) { storage = value }
private var storage: TV = null!!
}
fun <PTV> build(instructions: Buildee<PTV>.() -> Unit): Buildee<PTV> {
return Buildee<PTV>().apply(instructions)
}
@@ -1,5 +1,4 @@
// ISSUE: KT-60291
// FIR_IDENTICAL
// CHECK_TYPE_WITH_EXACT
fun test() {
@@ -0,0 +1,27 @@
// ISSUE: KT-60291
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = when ("") {
"true" -> build { setTypeVariable(TargetType()) }
"false" -> build {}
else -> Buildee()
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
checkExactType<Buildee<TargetType>>(buildee)
}
class TargetType
class Buildee<TV> {
fun setTypeVariable(value: TV) { storage = value }
private var storage: TV = null!!
}
fun <PTV> build(instructions: Buildee<PTV>.() -> Unit): Buildee<PTV> {
return Buildee<PTV>().apply(instructions)
}
@@ -1,5 +1,4 @@
// ISSUE: KT-60291
// FIR_IDENTICAL
// CHECK_TYPE_WITH_EXACT
fun test() {
@@ -1,30 +0,0 @@
// ISSUE: KT-61310
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
if (true) {
setTypeVariable(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>GenericBox<!>())
} else {
setTypeVariable(GenericBox<TargetType>())
}
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<GenericBox<TargetType>><!>>(buildee)
}
class TargetType
class GenericBox<T>
class Buildee<TV> {
fun setTypeVariable(value: TV) { storage = value }
private var storage: TV = null!!
}
fun <PTV> build(instructions: Buildee<PTV>.() -> Unit): Buildee<PTV> {
return Buildee<PTV>().apply(instructions)
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// ISSUE: KT-61310
// CHECK_TYPE_WITH_EXACT
@@ -10,11 +10,11 @@ fun test() {
}
val buildee = boundedBuild {
setBoundedTypeVariable(TargetType())
setBoundedTypeVariable(<!ARGUMENT_TYPE_MISMATCH!>DifferentType()<!>)
setBoundedTypeVariable(DifferentType())
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
checkExactType<BoundedBuildee<TargetType>>(<!ARGUMENT_TYPE_MISMATCH("BoundedBuildee<TargetType>; BoundedBuildee<kotlin.Any>")!>buildee<!>)
checkExactType<BoundedBuildee<TargetType>>(buildee)
}
@@ -3,12 +3,12 @@
// WITH_STDLIB
fun test() {
val buildee = <!NEW_INFERENCE_ERROR!>build {
val buildee = build {
select(
replaceTypeVariable(TargetType()),
DifferentType()
)
}<!>
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
checkExactType<Buildee<TargetType>>(buildee)
@@ -2,12 +2,12 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_ERROR!>build {
val buildee = build {
if (true)
replaceTypeVariable(TargetType())
else
DifferentType()
}<!>
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
checkExactType<Buildee<TargetType>>(buildee)
@@ -2,12 +2,12 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_ERROR!>build {
val buildee = build {
when {
true -> replaceTypeVariable(TargetType())
else -> DifferentType()
}
}<!>
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
checkExactType<Buildee<TargetType>>(buildee)
@@ -38,23 +38,23 @@ class Placeholder
// test 1: PTV is in consuming position (yield-case)
fun testYield() {
val arg: UserKlass = UserKlass()
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
val buildee = build {
nestedBuild {
yield(arg)
nestedYield(Placeholder())
}
}
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<UserKlass><!>>(buildee)
checkExactType<Buildee<UserKlass>>(buildee)
}
// test 2: PTV is in producing position (materialize-case)
fun testMaterialize() {
fun consume(arg: UserKlass) {}
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
val buildee = build {
nestedBuild {
consume(materialize())
nestedYield(Placeholder())
}
}
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<UserKlass><!>>(buildee)
checkExactType<Buildee<UserKlass>>(buildee)
}
@@ -27,5 +27,5 @@ fun testMaterialize() {
val buildee = build {
shareTypeInfo(null, materialize())
}
checkExactType<Buildee<Nothing?>>(<!ARGUMENT_TYPE_MISMATCH("Buildee<kotlin.Nothing?>; Buildee<kotlin.Nothing>")!>buildee<!>)
checkExactType<Buildee<Nothing?>>(buildee)
}
@@ -14,12 +14,12 @@
// PTV is returned as a last statement of the builder argument
fun testLastStatementReturn() {
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
val buildee = build {
materialize()
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<Unit><!>>(buildee)
checkExactType<Buildee<Unit>>(buildee)
}
/* REQUIRED DECLARATIONS */
@@ -49,40 +49,40 @@ fun main() {
add("one")
val secondParameter = get(1)
<!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(secondParameter) // ERROR: [OVERLOAD_RESOLUTION_AMBIGUITY] Overload resolution ambiguity. All these functions match.
println(secondParameter) // ERROR: [OVERLOAD_RESOLUTION_AMBIGUITY] Overload resolution ambiguity. All these functions match.
}
val list2 = buildList {
add("one")
<!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(get(1)) // ERROR: [OVERLOAD_RESOLUTION_AMBIGUITY] Overload resolution ambiguity. All these functions match.
println(get(1)) // ERROR: [OVERLOAD_RESOLUTION_AMBIGUITY] Overload resolution ambiguity. All these functions match.
}
val list3 = buildList {
add("one")
val secondParameter = Inv(get(1))
<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>(secondParameter)
foo(secondParameter)
}
val list4 = buildList {
add("one")
val secondParameter = get(1)
<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>(Inv(secondParameter))
foo(Inv(secondParameter))
}
val list5 = buildList {
add("one")
<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>(Inv(get(1)))
foo(Inv(get(1)))
}
val list6 = buildList {
add("one")
get(0).<!NONE_APPLICABLE!>bar<!>()
<!BUILDER_INFERENCE_STUB_RECEIVER!>get(0)<!>.bar()
}
val list7 = buildList {
add("one")
with (get(0)) {
<!NONE_APPLICABLE!>bar<!>()
bar()
}
}
val list71 = buildList {
@@ -90,7 +90,7 @@ fun main() {
with (get(0)) l1@ {
with (listOf(1)) {
<!NONE_APPLICABLE!>bar<!>()
bar()
}
}
}
@@ -99,21 +99,21 @@ fun main() {
with (get(0)) {
with (listOf(1)) {
<!NONE_APPLICABLE!>bar<!>()
bar()
}
}
}
val list8 = buildList {
add("one")
Inv(get(0)).<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo2<!>()
Inv(get(0)).foo2()
}
val list9 = buildList {
add("one")
with (get(0)) {
with (Inv(this)) {
<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo2<!>()
foo2()
}
}
}
@@ -122,7 +122,7 @@ fun main() {
with (get(0)) {
with (Inv(this)) {
<!NONE_APPLICABLE!>bar<!>()
bar()
}
}
}
@@ -148,46 +148,46 @@ fun main() {
val list13 = buildList {
add("one")
<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo000<!>(get(0), 0f, get(0))
foo000(get(0), 0f, get(0))
}
val list14 = buildList {
add("one")
<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo0000<!>(get(0), 0f, get(0))
foo0000(get(0), 0f, get(0))
}
val list17 = buildList l1@ {
add("one")
with (get(0)) {
<!NONE_APPLICABLE!>foo0003<!>(0f, this@l1.get(0))
foo0003(0f, <!ARGUMENT_TYPE_MISMATCH!>this@l1.get(0)<!>)
}
}
val list18 = buildList {
add("one")
get(0).<!NONE_APPLICABLE!>foo0003<!>(0f, get(0))
<!BUILDER_INFERENCE_STUB_RECEIVER!>get(0)<!>.foo0003(0f, <!ARGUMENT_TYPE_MISMATCH!>get(0)<!>)
}
val map1 = buildMap {
put(1, "one")
<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo11<!>(entries)
foo11(entries)
}
// There aren't specific errors below as casting value arguments doesn't make a resolve successful
val list15 = buildList {
add("one")
<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo0001<!>(get(0), 0f, get(0))
<!NONE_APPLICABLE!>foo0001<!>(get(0), 0f, get(0))
}
val list16 = buildList {
add("one")
<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo0002<!>(get(0), 0f, get(0))
<!NONE_APPLICABLE!>foo0002<!>(get(0), 0f, get(0))
}
}
@@ -211,13 +211,13 @@ fun test() {
add("")
with (get()) {
with (listOf(1)) {
<!NONE_APPLICABLE!>bar<!>()
bar()
}
}
},
{
put(1, "one")
<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo11<!>(entries())
foo11(entries())
}
)
}
@@ -0,0 +1,12 @@
// WITH_STDLIB
// ISSUE: KT-50293
fun main() {
val list = buildList {
add("one")
add("two")
val secondParameter = get(1)
println(secondParameter <!USELESS_CAST!>as String<!>)
}
}
@@ -1,4 +1,3 @@
// FIR_IDENTICAL
// WITH_STDLIB
// ISSUE: KT-50293
@@ -7,6 +7,6 @@ fun interface ReadOnlyProperty<in T, out V> {
}
class Problem {
val variable: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!><!INFERRED_TYPE_VARIABLE_INTO_POSSIBLE_EMPTY_INTERSECTION!>delegate<!>()<!> // delegate returns `ReadOnlyProperty<Problem, {CharSequence & Int}>`
val variable: Int by <!INFERRED_TYPE_VARIABLE_INTO_POSSIBLE_EMPTY_INTERSECTION!>delegate<!>() // delegate returns `ReadOnlyProperty<Problem, {CharSequence & Int}>`
fun <T : CharSequence> delegate() = null <!CAST_NEVER_SUCCEEDS!>as<!> ReadOnlyProperty<Problem, T>
}