K2: Adjust test data after PCLA implementation [red-to-red]
^KT-59791 In Progress
This commit is contained in:
committed by
Space Team
parent
276f5b26d8
commit
6052e24626
@@ -4,7 +4,7 @@
|
||||
fun test() {
|
||||
val buildee = build {
|
||||
setTypeVariable(TargetType())
|
||||
letForTypeVariable { it.<!NONE_APPLICABLE!>extensionProduceConcreteType<!>() }
|
||||
letForTypeVariable { <!BUILDER_INFERENCE_STUB_RECEIVER!>it<!>.extensionProduceConcreteType() }
|
||||
}
|
||||
// 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
-2
@@ -2,14 +2,14 @@
|
||||
// CHECK_TYPE_WITH_EXACT
|
||||
|
||||
fun test() {
|
||||
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
|
||||
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
|
||||
this as DerivedBuildee<*, *>
|
||||
getTypeVariableA()
|
||||
getTypeVariableB()
|
||||
}
|
||||
// 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<!>)
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -2,13 +2,13 @@
|
||||
// CHECK_TYPE_WITH_EXACT
|
||||
|
||||
fun test() {
|
||||
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
|
||||
val buildee = build {
|
||||
this as DerivedBuildee<*>
|
||||
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<!>)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
fun test() {
|
||||
val buildee = build {
|
||||
setTypeVariable(TargetType())
|
||||
consumeDifferentTypeCallable(<!ARGUMENT_TYPE_MISMATCH!>this::getTypeVariable<!>)
|
||||
consumeDifferentTypeCallable(this::<!INAPPLICABLE_CANDIDATE!>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
|
||||
checkExactType<Buildee<TargetType>>(buildee)
|
||||
checkExactType<Buildee<TargetType>>(<!ARGUMENT_TYPE_MISMATCH!>buildee<!>)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// CHECK_TYPE_WITH_EXACT
|
||||
|
||||
fun test() {
|
||||
val buildee = <!NEW_INFERENCE_ERROR!>build {
|
||||
val buildee = build {
|
||||
setTypeVariable(TargetType())
|
||||
consumeDifferentType(extensionReplaceOutProjectedTypeVariable(DifferentType()))
|
||||
}<!>
|
||||
consumeDifferentType(<!ARGUMENT_TYPE_MISMATCH!>extensionReplaceOutProjectedTypeVariable(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,10 +2,10 @@
|
||||
// CHECK_TYPE_WITH_EXACT
|
||||
|
||||
fun test() {
|
||||
val buildee = <!NEW_INFERENCE_ERROR!>build {
|
||||
val buildee = build {
|
||||
setTypeVariable(TargetType())
|
||||
consumeDifferentTypeSubtype(getTypeVariable())
|
||||
}<!>
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>consumeDifferentTypeSubtype<!>(<!ARGUMENT_TYPE_MISMATCH!>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
|
||||
checkExactType<Buildee<TargetType>>(buildee)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
fun test() {
|
||||
val buildee = <!NEW_INFERENCE_ERROR!>build {
|
||||
setTypeVariable(DifferentType())
|
||||
consumeBuildeeReceiver()
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>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
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
// ISSUE: KT-59798
|
||||
// CHECK_TYPE_WITH_EXACT
|
||||
|
||||
fun test() {
|
||||
val buildee = build {
|
||||
setTypeVariable(TargetType())
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>getTypeVariable().let {}<!>
|
||||
}
|
||||
// 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 }
|
||||
fun getTypeVariable(): TV = storage
|
||||
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-59798
|
||||
// CHECK_TYPE_WITH_EXACT
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
fun test() {
|
||||
val buildee = <!NEW_INFERENCE_ERROR!>build {
|
||||
setTypeVariable(TargetType())
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>getTypeVariable().consumeDifferentTypeReceiver()<!>
|
||||
getTypeVariable().<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>consumeDifferentTypeReceiver<!>()
|
||||
}<!>
|
||||
// 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
|
||||
|
||||
@@ -8,7 +8,7 @@ fun test() {
|
||||
val targetTypeBuildee = build {
|
||||
var variable = getTypeVariable()
|
||||
variable = TargetType()
|
||||
variable.targetTypeMemberFunction()
|
||||
variable.<!UNRESOLVED_REFERENCE!>targetTypeMemberFunction<!>()
|
||||
}
|
||||
// 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
|
||||
@@ -26,15 +26,15 @@ fun test() {
|
||||
val anyBuildee = build {
|
||||
var variable = getTypeVariable()
|
||||
variable = TargetType()
|
||||
variable.targetTypeMemberFunction()
|
||||
variable = DifferentType()
|
||||
variable.<!UNRESOLVED_REFERENCE!>targetTypeMemberFunction<!>()
|
||||
variable = <!ASSIGNMENT_TYPE_MISMATCH!>DifferentType()<!>
|
||||
variable.<!UNRESOLVED_REFERENCE!>targetTypeMemberFunction<!>()
|
||||
variable = TargetType()
|
||||
variable.targetTypeMemberFunction()
|
||||
variable.<!UNRESOLVED_REFERENCE!>targetTypeMemberFunction<!>()
|
||||
}
|
||||
// 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<Any>>(anyBuildee)
|
||||
checkExactType<Buildee<Any>>(<!ARGUMENT_TYPE_MISMATCH!>anyBuildee<!>)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -5,7 +5,7 @@ fun foo(block: () -> (() -> Int)) {}
|
||||
|
||||
fun test() {
|
||||
val x = <!ANONYMOUS_FUNCTION_WITH_NAME!>fun named1(x: Int): Int { return 1 }<!>
|
||||
x <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<Function1<Int, Int>>() }
|
||||
x <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>Function1<Int, Int><!>>() }
|
||||
|
||||
foo { <!ARGUMENT_TYPE_MISMATCH!>fun named2(): Int {return 1}<!> }
|
||||
foo({ <!ARGUMENT_TYPE_MISMATCH!>fun named3() = 1<!> })
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// ISSUE: KT-61077
|
||||
|
||||
val test: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE, INFERRED_TYPE_VARIABLE_INTO_POSSIBLE_EMPTY_INTERSECTION!>materializeDelegate()<!>
|
||||
val test: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!>materializeDelegate()<!>
|
||||
|
||||
fun <T: CharSequence> materializeDelegate(): Box<T> = TODO()
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -31,8 +31,8 @@ fun bar(aInstance: A, bInstance: B) {
|
||||
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!>(bInstance) {
|
||||
<!CANNOT_INFER_PARAMETER_TYPE, COMPONENT_FUNCTION_MISSING, COMPONENT_FUNCTION_MISSING!>(a, b)<!>, (c, d) ->
|
||||
a checkType { _<Int>() }
|
||||
b checkType { _<String>() }
|
||||
a checkType { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>Int<!>>() }
|
||||
b checkType { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>String<!>>() }
|
||||
c checkType { _<Double>() }
|
||||
d checkType { _<Short>() }
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -20,7 +20,7 @@ class A : Outer<Double, Short>() {
|
||||
|
||||
fun foo() {
|
||||
Derived().foo() checkType { _<Outer<String, Int>.Inner<Char>>() }
|
||||
Derived().baz() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<Map<Char, String>>() }
|
||||
Derived().baz() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>Map<Char, String><!>>() }
|
||||
A.B().bar() checkType { _<Outer<Float, Long>.Inner<String>>() }
|
||||
A.B().x() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<Map<String, Float>>() }
|
||||
A.B().x() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>Map<String, Float><!>>() }
|
||||
}
|
||||
|
||||
+2
-2
@@ -42,7 +42,7 @@ fun test() {
|
||||
x = foobar<String>()
|
||||
|
||||
x().foo().a() checkType { _<A<String, Double, Short, Long>>() }
|
||||
x().bar() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<A<String, Double, Short, Char>>() }
|
||||
x().bar() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>A<String, Double, Short, Char><!>>() }
|
||||
|
||||
x = <!ASSIGNMENT_TYPE_MISMATCH!>foobar<Int>()<!>
|
||||
|
||||
@@ -50,5 +50,5 @@ fun test() {
|
||||
y = noParameters()
|
||||
|
||||
y().foo().a() checkType { _<A<Any, Double, Short, Long>>() }
|
||||
y().bar() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<A<Any, Double, Short, Char>>() }
|
||||
y().bar() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>A<Any, Double, Short, Char><!>>() }
|
||||
}
|
||||
|
||||
+2
-2
@@ -43,7 +43,7 @@ class Outer<T> {
|
||||
x = foobar<String>()
|
||||
|
||||
x().foo().a() checkType { _<A<T, F, String, Double, Short, Long>>() }
|
||||
x().bar() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<A<T, F, String, Double, Short, Char>>() }
|
||||
x().bar() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>A<T, F, String, Double, Short, Char><!>>() }
|
||||
|
||||
x = <!ASSIGNMENT_TYPE_MISMATCH!>foobar<Int>()<!>
|
||||
x = <!ASSIGNMENT_TYPE_MISMATCH!>z.foobar<String>()<!>
|
||||
@@ -52,7 +52,7 @@ class Outer<T> {
|
||||
y = noParameters()
|
||||
|
||||
y().foo().a() checkType { _<A<T, F, Any, Double, Short, Long>>() }
|
||||
y().bar() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<A<T, F, Any, Double, Short, Char>>() }
|
||||
y().bar() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>A<T, F, Any, Double, Short, Char><!>>() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,5 +15,5 @@ class Derived : BaseDerived2<Int>() {
|
||||
|
||||
fun foo() {
|
||||
Derived().foo() checkType { _<Outer<Int, String>.Inner<Char>>() }
|
||||
Derived().baz() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<Map<Char, Int>>() }
|
||||
Derived().baz() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>Map<Char, Int><!>>() }
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -15,7 +15,7 @@ fun main() {
|
||||
}
|
||||
<!TYPE_MISMATCH!>buildList {
|
||||
add(3)
|
||||
val x: String = <!INITIALIZER_TYPE_MISMATCH!>get(0)<!>
|
||||
val x: String = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>get(0)<!>
|
||||
}<!>
|
||||
buildList {
|
||||
add("3")
|
||||
@@ -28,6 +28,6 @@ fun main() {
|
||||
}
|
||||
<!TYPE_MISMATCH!>buildList {
|
||||
add("")
|
||||
val x: StringBuilder = <!INITIALIZER_TYPE_MISMATCH!>get(0)<!>
|
||||
val x: StringBuilder = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>get(0)<!>
|
||||
}<!>
|
||||
}
|
||||
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
// WITH_STDLIB
|
||||
// FIR_DUMP
|
||||
// SKIP_TXT
|
||||
|
||||
fun Any?.test() {}
|
||||
|
||||
class Bar {
|
||||
fun test() {}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
|
||||
buildList {
|
||||
add(Bar())
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>this.get(0).test()<!> // resolved to Any?.test
|
||||
}
|
||||
buildList<Bar> {
|
||||
add(Bar())
|
||||
this.get(0).test() // resolved to Bar.test
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
FILE: errorOnStubReceiver.fir.kt
|
||||
FILE: errorOnStubReceiver.kt
|
||||
public final fun R|kotlin/Any?|.test(): R|kotlin/Unit| {
|
||||
}
|
||||
public final class Bar : R|kotlin/Any| {
|
||||
@@ -13,7 +13,7 @@ FILE: errorOnStubReceiver.fir.kt
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
R|kotlin/collections/buildList|<R|Bar|>(<L> = buildList@fun R|kotlin/collections/MutableList<Bar>|.<anonymous>(): R|kotlin/Unit| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
this@R|special/anonymous|.R|SubstitutionOverride<kotlin/collections/MutableList.add: R|kotlin/Boolean|>|(R|/Bar.Bar|())
|
||||
this@R|special/anonymous|.R|SubstitutionOverride<kotlin/collections/MutableList.get: R|Stub (chain inference): TypeVariable(E)|>|(Int(0)).R|/test<Inapplicable(RESOLVED_WITH_ERROR): /test>#|()
|
||||
this@R|special/anonymous|.R|SubstitutionOverride<kotlin/collections/MutableList.get: R|Bar|>|(Int(0)).R|/test<Inapplicable(RESOLVED_WITH_ERROR): /test>#|()
|
||||
}
|
||||
)
|
||||
R|kotlin/collections/buildList|<R|Bar|>(<L> = buildList@fun R|kotlin/collections/MutableList<Bar>|.<anonymous>(): R|kotlin/Unit| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_STDLIB
|
||||
// FIR_DUMP
|
||||
// SKIP_TXT
|
||||
|
||||
+2
@@ -1 +1,3 @@
|
||||
/kt47986Default.fir.kt:(175,183): error: Not enough information to infer type argument for 'K'.
|
||||
|
||||
/kt47986Default.fir.kt:(194,197): error: Not enough information to infer type argument for 'K'.
|
||||
|
||||
+1
-1
@@ -7,6 +7,6 @@ fun <K> Foo<K>.bar(x: Int = 1) {}
|
||||
|
||||
fun main() {
|
||||
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> {
|
||||
bar()
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>bar<!>()
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+2
@@ -1 +1,3 @@
|
||||
/kt47986Disabled.fir.kt:(249,257): error: Not enough information to infer type argument for 'K'.
|
||||
|
||||
/kt47986Disabled.fir.kt:(268,271): error: Not enough information to infer type argument for 'K'.
|
||||
|
||||
+1
-1
@@ -8,6 +8,6 @@ fun <K> Foo<K>.bar(x: Int = 1) {}
|
||||
|
||||
fun main() {
|
||||
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> {
|
||||
bar()
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>bar<!>()
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// !LANGUAGE: +ForbidInferringPostponedTypeVariableIntoDeclaredUpperBound
|
||||
class Foo<K>
|
||||
|
||||
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
|
||||
|
||||
fun <K> Foo<K>.bar(x: Int = 1) {}
|
||||
|
||||
fun main() {
|
||||
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>bar<!>()
|
||||
}
|
||||
}
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ForbidInferringPostponedTypeVariableIntoDeclaredUpperBound
|
||||
class Foo<K>
|
||||
|
||||
|
||||
+2
@@ -1 +1,3 @@
|
||||
/kt47986_2.fir.kt:(187,195): error: Not enough information to infer type argument for 'K'.
|
||||
|
||||
/kt47986_2.fir.kt:(234,237): error: Not enough information to infer type argument for 'L'.
|
||||
|
||||
+1
-1
@@ -9,6 +9,6 @@ fun <K> id(x: K) = x
|
||||
|
||||
fun main() {
|
||||
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> { // can't infer
|
||||
val y = id(::bar)
|
||||
val y = id(::<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>bar<!>)
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -1 +1,5 @@
|
||||
/kt47986_3.fir.kt:(181,189): error: Not enough information to infer type argument for 'K'.
|
||||
|
||||
/kt47986_3.fir.kt:(200,203): error: Not enough information to infer type argument for 'K'.
|
||||
|
||||
/kt47986_3.fir.kt:(200,203): error: Not enough information to infer type argument for 'N'.
|
||||
|
||||
+1
-1
@@ -7,6 +7,6 @@ fun <K: N, N> Foo<K>.bar(x: Int = 1) {}
|
||||
|
||||
fun main() {
|
||||
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> {
|
||||
bar()
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>bar<!>()
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
class Foo<K>
|
||||
|
||||
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
|
||||
|
||||
class Bar<K>
|
||||
|
||||
fun <K: Bar<N>, N: Bar<K>> Foo<K>.bar(x: Int = 1) {}
|
||||
|
||||
fun main() {
|
||||
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>bar<!>()
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
class Foo<K>
|
||||
|
||||
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
|
||||
|
||||
+2
@@ -1 +1,3 @@
|
||||
/kt51464.fir.kt:(298,307): error: Not enough information to infer type argument for 'R'.
|
||||
|
||||
/kt51464.fir.kt:(310,316): error: Not enough information to infer type argument for 'T'.
|
||||
|
||||
+1
-1
@@ -9,5 +9,5 @@ fun <T, R> Flow<T>.transform(transform: FlowCollector<R>.(T) -> Unit): Flow<R> =
|
||||
|
||||
fun f() {
|
||||
fun <T> doEmit(collector: FlowCollector<T>) {}
|
||||
flowOf(1).<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>transform<!> { doEmit(this) }
|
||||
flowOf(1).<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>transform<!> { <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>doEmit<!>(this) }
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -19,13 +19,13 @@ fun <K> capture(x: Inv<K>): K = null as K
|
||||
fun <I> id(x: I): I = null as I
|
||||
|
||||
fun main() {
|
||||
<!NEW_INFERENCE_ERROR!>build {
|
||||
build {
|
||||
emit("")
|
||||
// K is fixed into CapturedType(out NotFixed: TypeVariable(R)
|
||||
capture(id(getOut())) // unexpected TYPE_MISMATCH (KT-63996)
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>capture<!>(<!ARGUMENT_TYPE_MISMATCH!>id(getOut())<!>) // unexpected TYPE_MISMATCH (KT-63996)
|
||||
// capture(getOut()) // OK!!!
|
||||
Unit
|
||||
}<!>
|
||||
}
|
||||
build<String> {
|
||||
emit("")
|
||||
// K is fixed into CapturedType(out NotFixed: TypeVariable(R)
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ fun <E> intersect(vararg x: In<E>): E = null as E
|
||||
fun test() {
|
||||
val ret = build {
|
||||
emit("1")
|
||||
intersect(getIn(), getIn())
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>intersect<!>(getIn(), getIn())
|
||||
intersect(getIn(), Test.foo(getIn()))
|
||||
intersect(Test.foo(getIn()), Test.foo(getIn()))
|
||||
intersect(Test.foo(getIn()), getIn())
|
||||
@@ -46,4 +46,4 @@ fun test() {
|
||||
}
|
||||
""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+72
-72
@@ -17,58 +17,58 @@ fun Any.test() {}
|
||||
fun Any?.test2() {}
|
||||
|
||||
fun test() {
|
||||
val ret1 = <!NEW_INFERENCE_ERROR!>build {
|
||||
val ret1 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()?.test()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()?.test2()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get().test2()<!>
|
||||
get()?.hashCode()
|
||||
get()?.equals(1)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>?.test()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>?.test2()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>.test2()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>?.hashCode()
|
||||
get()?.<!NONE_APPLICABLE!>equals<!>(1)
|
||||
// there is `String?.equals` extension
|
||||
get().equals("")
|
||||
}<!>
|
||||
val ret2 = <!NEW_INFERENCE_ERROR!>build {
|
||||
get().<!NONE_APPLICABLE!>equals<!>("")
|
||||
}
|
||||
val ret2 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()?.test()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()?.test2()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get().test2()<!>
|
||||
get()?.hashCode()
|
||||
get()?.equals(1)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>?.test()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>?.test2()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>.test2()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>?.hashCode()
|
||||
get()?.<!NONE_APPLICABLE!>equals<!>(1)
|
||||
val x = get()
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
x.equals("")
|
||||
}<!>
|
||||
val ret3 = <!NEW_INFERENCE_ERROR!>build {
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!>?.hashCode()
|
||||
x?.<!NONE_APPLICABLE!>equals<!>(1)
|
||||
x.<!NONE_APPLICABLE!>equals<!>("")
|
||||
}
|
||||
val ret3 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()?.test()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()?.test2()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get().test2()<!>
|
||||
get()?.hashCode()
|
||||
get()?.equals(1)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>?.test()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>?.test2()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>.test2()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>?.hashCode()
|
||||
get()?.<!NONE_APPLICABLE!>equals<!>(1)
|
||||
val x = get()
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!>?.hashCode()
|
||||
x?.<!NONE_APPLICABLE!>equals<!>(1)
|
||||
|
||||
if (get() == null) {}
|
||||
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>get() === null<!>) {}
|
||||
|
||||
if (x != null) {
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!>equals(1)
|
||||
x.equals("")
|
||||
x.hashCode()
|
||||
x.toString()
|
||||
x.test()
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!>test2()
|
||||
x.test2()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
|
||||
x.<!NONE_APPLICABLE!>equals<!>("")
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!>.hashCode()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!>.toString()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!>.test()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>test2()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!>.test2()
|
||||
}
|
||||
|
||||
""
|
||||
}<!>
|
||||
}
|
||||
val ret4 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
@@ -104,7 +104,7 @@ fun test() {
|
||||
emit(null)
|
||||
val x = get()
|
||||
if (x == null) {
|
||||
x<!UNSAFE_CALL!>.<!>test()
|
||||
x.test()
|
||||
}
|
||||
|
||||
""
|
||||
@@ -144,44 +144,44 @@ fun test() {
|
||||
emit(null)
|
||||
val x = get()
|
||||
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
|
||||
x<!UNSAFE_CALL!>.<!>test()
|
||||
x.test()
|
||||
}
|
||||
|
||||
""
|
||||
}
|
||||
val ret408 = <!NEW_INFERENCE_ERROR!>build {
|
||||
val ret408 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
val x = get()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x.test()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!><!UNSAFE_CALL!>.<!>test()
|
||||
|
||||
""
|
||||
}<!>
|
||||
val ret41 = <!NEW_INFERENCE_ERROR!>build {
|
||||
}
|
||||
val ret41 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()?.test()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()?.test2()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get().test2()<!>
|
||||
get()?.hashCode()
|
||||
get()?.equals(1)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>?.test()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>?.test2()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>.test2()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>?.hashCode()
|
||||
get()?.<!NONE_APPLICABLE!>equals<!>(1)
|
||||
val x = get()
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!>?.hashCode()
|
||||
x?.<!NONE_APPLICABLE!>equals<!>(1)
|
||||
|
||||
if (get() == null) {}
|
||||
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>get() === null<!>) {}
|
||||
|
||||
if (x == null) {
|
||||
x?.hashCode()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
|
||||
}
|
||||
|
||||
if (x == null) {
|
||||
x?.<!NONE_APPLICABLE!>equals<!>(1)
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
|
||||
}
|
||||
|
||||
if (x == null) {
|
||||
x?.test2()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>test2()
|
||||
}
|
||||
|
||||
if (x == null) {
|
||||
@@ -189,15 +189,15 @@ fun test() {
|
||||
}
|
||||
|
||||
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
|
||||
x?.hashCode()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
|
||||
}
|
||||
|
||||
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
|
||||
x?.<!NONE_APPLICABLE!>equals<!>(1)
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
|
||||
}
|
||||
|
||||
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
|
||||
x?.test2()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>test2()
|
||||
}
|
||||
|
||||
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
|
||||
@@ -205,7 +205,7 @@ fun test() {
|
||||
}
|
||||
|
||||
""
|
||||
}<!>
|
||||
}
|
||||
val ret5 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
@@ -239,7 +239,7 @@ fun test() {
|
||||
emit(null)
|
||||
val x = get()
|
||||
if (x == null) {
|
||||
x<!UNSAFE_CALL!>.<!>test()
|
||||
x.test()
|
||||
}
|
||||
""
|
||||
}
|
||||
@@ -276,39 +276,39 @@ fun test() {
|
||||
emit(null)
|
||||
val x = get()
|
||||
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
|
||||
x<!UNSAFE_CALL!>.<!>test()
|
||||
x.test()
|
||||
}
|
||||
""
|
||||
}
|
||||
val ret508 = <!NEW_INFERENCE_ERROR!>build {
|
||||
val ret508 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
val x = get()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x.test()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!><!UNSAFE_CALL!>.<!>test()
|
||||
""
|
||||
}<!>
|
||||
val ret51 = <!NEW_INFERENCE_ERROR!>build {
|
||||
}
|
||||
val ret51 = build {
|
||||
emit(1)
|
||||
emit(null)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()?.test()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()?.test2()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get().test2()<!>
|
||||
get()?.hashCode()
|
||||
get()?.equals(1)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>?.test()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>?.test2()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>.test2()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>get()<!>?.hashCode()
|
||||
get()?.<!NONE_APPLICABLE!>equals<!>(1)
|
||||
val x = get()
|
||||
x?.hashCode()
|
||||
x?.equals(1)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!>?.hashCode()
|
||||
x?.<!NONE_APPLICABLE!>equals<!>(1)
|
||||
|
||||
if (get() == null) {}
|
||||
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>get() === null<!>) {}
|
||||
|
||||
if (x == null) {
|
||||
x?.hashCode()
|
||||
x?.<!NONE_APPLICABLE!>equals<!>(1)
|
||||
x?.test2()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>test2()
|
||||
x.test2()
|
||||
}
|
||||
|
||||
""
|
||||
}<!>
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+6
-6
@@ -25,27 +25,27 @@ fun <R1 : R2, R2> build4(x: R2, block: TestInterface<R1>.() -> Unit): R1 = TODO(
|
||||
fun test(a: String?) {
|
||||
val ret1 = build {
|
||||
emit(1)
|
||||
get()<!UNNECESSARY_SAFE_CALL!>?.<!>equals("")
|
||||
get()<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>("")
|
||||
val x = get()
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!>equals("")
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>("")
|
||||
x <!USELESS_ELVIS!>?: 1<!>
|
||||
x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
""
|
||||
}
|
||||
val ret2 = build2 {
|
||||
emit(1)
|
||||
get()<!UNNECESSARY_SAFE_CALL!>?.<!>equals("")
|
||||
get()<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>("")
|
||||
val x = get()
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!>equals("")
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>("")
|
||||
x <!USELESS_ELVIS!>?: 1<!>
|
||||
x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
""
|
||||
}
|
||||
val ret3 = build3 {
|
||||
emit(1)
|
||||
get()<!UNNECESSARY_SAFE_CALL!>?.<!>equals("")
|
||||
get()<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>("")
|
||||
val x = get()
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!>equals("")
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>("")
|
||||
x <!USELESS_ELVIS!>?: 1<!>
|
||||
x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
""
|
||||
|
||||
+23
-23
@@ -9,9 +9,9 @@ fun use(p: Any?) {}
|
||||
|
||||
fun test1() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>a<!> {
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>this.get(0).extension()<!>
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER!>this.get(0)::extension<!>)
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER!>it::extension<!>)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>this.get(0)<!>.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>extension<!>()
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER!>this.get(0)<!>::extension)
|
||||
use(it::extension)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,19 +19,19 @@ fun test1() {
|
||||
fun test2() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>a<!> {
|
||||
val v = this.get(0)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>v.extension()<!>
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER!>v::extension<!>)
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER!>it::extension<!>)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>v<!>.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>extension<!>()
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER!>v<!>::extension)
|
||||
use(it::extension)
|
||||
}
|
||||
}
|
||||
|
||||
fun test3() {
|
||||
operator fun <T> T.getValue(thisRef: Any?, prop: Any?): T = this
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>a<!> {
|
||||
val v by this.get(0)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>v.extension()<!>
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER!>v::extension<!>)
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER!>it::extension<!>)
|
||||
val v by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>this.get(0)<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>v<!>.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>extension<!>()
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER!>v<!>::extension)
|
||||
use(it::extension)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,10 +41,10 @@ fun test4() {
|
||||
operator fun <T> T.provideDelegate(thisRef: Any?, prop: Any?): Box<T> = Box(this)
|
||||
operator fun <T> Box<T>.getValue(thisRef: Any?, prop: Any?): T = this.t
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>a<!> {
|
||||
val v by this.get(0)
|
||||
v.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>extension<!>()
|
||||
use(v::extension)
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER!>it::extension<!>)
|
||||
val v by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>this.get(0)<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>v<!>.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>extension<!>()
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER!>v<!>::extension)
|
||||
use(it::extension)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,20 +53,20 @@ fun <R> b(lambda: R.(List<R>) -> Unit) {}
|
||||
fun test5() {
|
||||
|
||||
operator fun <T> T.invoke(): T = this
|
||||
b {
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>extension()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!><!BUILDER_INFERENCE_STUB_RECEIVER!>this()<!>.extension()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>use(<!BUILDER_INFERENCE_STUB_RECEIVER!>::extension<!>)<!>
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>b<!> {
|
||||
extension()
|
||||
<!CANNOT_INFER_PARAMETER_TYPE!>this<!><!NO_VALUE_FOR_PARAMETER!>()<!>.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>extension<!>()
|
||||
use(::extension)
|
||||
}
|
||||
}
|
||||
|
||||
val <T> T.genericLambda: T.((T) -> Unit) -> Unit get() = {}
|
||||
|
||||
fun test6() {
|
||||
b {
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>extension()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>genericLambda { }<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>genericLambda { it.extension() }<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>use(<!BUILDER_INFERENCE_STUB_RECEIVER!>::extension<!>)<!>
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>b<!> {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, UNRESOLVED_REFERENCE_WRONG_RECEIVER!>extension<!>()
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>genericLambda<!> { }
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>genericLambda<!> { it.extension() }
|
||||
use(::extension)
|
||||
}
|
||||
}
|
||||
|
||||
+14
-14
@@ -10,8 +10,8 @@ fun use(p: Any?) {}
|
||||
|
||||
fun test1() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>a<!> {
|
||||
this.get(0).extension()
|
||||
use(this.get(0)::extension)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>this.get(0)<!>.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>extension<!>()
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER!>this.get(0)<!>::extension)
|
||||
use(it::extension)
|
||||
}
|
||||
}
|
||||
@@ -20,8 +20,8 @@ fun test1() {
|
||||
fun test2() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>a<!> {
|
||||
val v = this.get(0)
|
||||
v.extension()
|
||||
use(v::extension)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>v<!>.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>extension<!>()
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER!>v<!>::extension)
|
||||
use(it::extension)
|
||||
}
|
||||
}
|
||||
@@ -29,9 +29,9 @@ fun test2() {
|
||||
fun test3() {
|
||||
operator fun <T> T.getValue(thisRef: Any?, prop: Any?): T = this
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>a<!> {
|
||||
val v by this.get(0)
|
||||
v.extension()
|
||||
use(v::extension)
|
||||
val v by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>this.get(0)<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>v<!>.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>extension<!>()
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER!>v<!>::extension)
|
||||
use(it::extension)
|
||||
}
|
||||
}
|
||||
@@ -42,9 +42,9 @@ fun test4() {
|
||||
operator fun <T> T.provideDelegate(thisRef: Any?, prop: Any?): Box<T> = Box(this)
|
||||
operator fun <T> Box<T>.getValue(thisRef: Any?, prop: Any?): T = this.t
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>a<!> {
|
||||
val v by this.get(0)
|
||||
v.extension()
|
||||
use(v::extension)
|
||||
val v by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>this.get(0)<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>v<!>.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>extension<!>()
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER!>v<!>::extension)
|
||||
use(it::extension)
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ fun test5() {
|
||||
operator fun <T> T.invoke(): T = this
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>b<!> {
|
||||
extension()
|
||||
this().extension()
|
||||
<!CANNOT_INFER_PARAMETER_TYPE!>this<!><!NO_VALUE_FOR_PARAMETER!>()<!>.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>extension<!>()
|
||||
use(::extension)
|
||||
}
|
||||
}
|
||||
@@ -65,9 +65,9 @@ val <T> T.genericLambda: T.((T) -> Unit) -> Unit get() = {}
|
||||
|
||||
fun test6() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>b<!> {
|
||||
extension()
|
||||
genericLambda { }
|
||||
genericLambda { it.extension() }
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, UNRESOLVED_REFERENCE_WRONG_RECEIVER!>extension<!>()
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>genericLambda<!> { }
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>genericLambda<!> { it.extension() }
|
||||
use(::extension)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,4 +45,4 @@ fun test4() {
|
||||
}
|
||||
}
|
||||
|
||||
fun fail(): Nothing = throw Exception()
|
||||
fun fail(): Nothing = throw Exception()
|
||||
Vendored
+1
-1
@@ -33,7 +33,7 @@ fun foo() {
|
||||
val dates3 = <!NEW_INFERENCE_ERROR!>myRun {
|
||||
when {
|
||||
else -> return@myRun <!RETURN_TYPE_MISMATCH!>buildList {
|
||||
add(4)
|
||||
add(<!ARGUMENT_TYPE_MISMATCH!>4<!>)
|
||||
}<!>
|
||||
}
|
||||
}<!>
|
||||
|
||||
+4
-4
@@ -20,9 +20,9 @@ public abstract class CollectionWithSize implements java.util.Collection<String>
|
||||
// FILE: main.kt
|
||||
|
||||
fun main(c: CollectionWithSize) {
|
||||
CompressionType.ZIP.<!OVERLOAD_RESOLUTION_AMBIGUITY!>name<!> <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<Double>() }
|
||||
c.<!OVERLOAD_RESOLUTION_AMBIGUITY!>size<!> <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<String>() }
|
||||
CompressionType.ZIP.<!OVERLOAD_RESOLUTION_AMBIGUITY!>name<!> <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>Double<!>>() }
|
||||
c.<!OVERLOAD_RESOLUTION_AMBIGUITY!>size<!> <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>String<!>>() }
|
||||
|
||||
CompressionType.ZIP::<!OVERLOAD_RESOLUTION_AMBIGUITY!>name<!> <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<kotlin.reflect.KProperty0<Double>>() }
|
||||
c::<!OVERLOAD_RESOLUTION_AMBIGUITY!>size<!> <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<kotlin.reflect.KProperty0<String>>() }
|
||||
CompressionType.ZIP::<!OVERLOAD_RESOLUTION_AMBIGUITY!>name<!> <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>kotlin.reflect.KProperty0<Double><!>>() }
|
||||
c::<!OVERLOAD_RESOLUTION_AMBIGUITY!>size<!> <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>kotlin.reflect.KProperty0<String><!>>() }
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@ public class A {
|
||||
// FILE: main.kt
|
||||
|
||||
fun foo(a: A) {
|
||||
a.<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<String>() }
|
||||
A.<!OVERLOAD_RESOLUTION_AMBIGUITY!>bar<!>() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<String>() }
|
||||
a.<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>String<!>>() }
|
||||
A.<!OVERLOAD_RESOLUTION_AMBIGUITY!>bar<!>() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>String<!>>() }
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ interface A : MutableCollection<String> {
|
||||
}
|
||||
|
||||
fun foo(x: MutableCollection<Int>, y: Collection<String>, z: A) {
|
||||
x.<!UNRESOLVED_REFERENCE!>nonExistingMethod<!>(1).<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<String>() }
|
||||
x.<!UNRESOLVED_REFERENCE!>nonExistingMethod<!>(1).<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>String<!>>() }
|
||||
y.<!UNRESOLVED_REFERENCE!>nonExistingMethod<!>("")
|
||||
z.<!UNRESOLVED_REFERENCE!>nonExistingMethod<!>("")
|
||||
}
|
||||
|
||||
@@ -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 <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!><!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>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user