Delay ForbidInferringPostponedTypeVariableIntoDeclaredUpperBound to 2.0
#KT-57395 Fixed Related to KT-47986
This commit is contained in:
committed by
Space Team
parent
5ef62c8760
commit
a43a16b25b
+10
-1
@@ -1,4 +1,13 @@
|
||||
/kt47986Default.kt:10:13: error: not enough information to infer type variable K
|
||||
/kt47986Default.kt:4:18: warning: parameter 'builderAction' is never used
|
||||
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
|
||||
^
|
||||
/kt47986Default.kt:6:20: warning: parameter 'x' is never used
|
||||
fun <K> Foo<K>.bar(x: Int = 1) {}
|
||||
^
|
||||
/kt47986Default.kt:9:9: warning: variable 'x' is never used
|
||||
val x = buildFoo {
|
||||
^
|
||||
/kt47986Default.kt:9:13: warning: type parameter for a type argument K can't be inferred into declared upper bounds. Please provide any use-site type information. It will become an error in future releases.
|
||||
val x = buildFoo {
|
||||
^
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
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<!> {
|
||||
bar()
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
class Foo<K>
|
||||
|
||||
@@ -7,7 +6,7 @@ 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<!> {
|
||||
val x = <!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>buildFoo<!> {
|
||||
bar()
|
||||
}
|
||||
}
|
||||
|
||||
+10
-1
@@ -1,4 +1,13 @@
|
||||
/kt47986_2.kt:12:13: error: not enough information to infer type variable K
|
||||
/kt47986_2.kt:4:18: warning: parameter 'builderAction' is never used
|
||||
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
|
||||
^
|
||||
/kt47986_2.kt:11:9: warning: variable 'x' is never used
|
||||
val x = buildFoo { // can't infer
|
||||
^
|
||||
/kt47986_2.kt:11:13: warning: type parameter for a type argument K can't be inferred into declared upper bounds. Please provide any use-site type information. It will become an error in future releases.
|
||||
val x = buildFoo { // can't infer
|
||||
^
|
||||
/kt47986_2.kt:12:13: warning: variable 'y' is never used
|
||||
val y = id(::bar)
|
||||
^
|
||||
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
class Foo<K>
|
||||
|
||||
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
|
||||
|
||||
fun <L> Foo<L>.bar() {}
|
||||
|
||||
fun <K> id(x: K) = x
|
||||
|
||||
fun main() {
|
||||
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> { // can't infer
|
||||
val y = id(::bar)
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
class Foo<K>
|
||||
|
||||
@@ -9,7 +8,7 @@ fun <L> Foo<L>.bar() {}
|
||||
fun <K> id(x: K) = x
|
||||
|
||||
fun main() {
|
||||
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> { // can't infer
|
||||
val x = <!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>buildFoo<!> { // can't infer
|
||||
val y = id(::bar)
|
||||
}
|
||||
}
|
||||
|
||||
+10
-1
@@ -1,4 +1,13 @@
|
||||
/kt47986_3.kt:10:13: error: not enough information to infer type variable K
|
||||
/kt47986_3.kt:4:18: warning: parameter 'builderAction' is never used
|
||||
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
|
||||
^
|
||||
/kt47986_3.kt:6:26: warning: parameter 'x' is never used
|
||||
fun <K: N, N> Foo<K>.bar(x: Int = 1) {}
|
||||
^
|
||||
/kt47986_3.kt:9:9: warning: variable 'x' is never used
|
||||
val x = buildFoo {
|
||||
^
|
||||
/kt47986_3.kt:9:13: warning: type parameter for a type argument K can't be inferred into declared upper bounds. Please provide any use-site type information. It will become an error in future releases.
|
||||
val x = buildFoo {
|
||||
^
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
class Foo<K>
|
||||
|
||||
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
|
||||
|
||||
fun <K: N, N> Foo<K>.bar(x: Int = 1) {}
|
||||
|
||||
fun main() {
|
||||
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> {
|
||||
bar()
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
class Foo<K>
|
||||
|
||||
@@ -7,7 +6,7 @@ fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
|
||||
fun <K: N, N> Foo<K>.bar(x: Int = 1) {}
|
||||
|
||||
fun main() {
|
||||
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> {
|
||||
val x = <!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>buildFoo<!> {
|
||||
bar()
|
||||
}
|
||||
}
|
||||
|
||||
+10
-1
@@ -1,4 +1,13 @@
|
||||
/kt51464.kt:13:15: error: not enough information to infer type variable R
|
||||
/kt51464.kt:2:16: warning: parameter 'value' is never used
|
||||
fun <T> flowOf(value: T): Flow<T> = TODO()
|
||||
^
|
||||
/kt51464.kt:8:30: warning: parameter 'transform' is never used
|
||||
fun <T, R> Flow<T>.transform(transform: FlowCollector<R>.(T) -> Unit): Flow<R> = TODO()
|
||||
^
|
||||
/kt51464.kt:11:20: warning: parameter 'collector' is never used
|
||||
fun <T> doEmit(collector: FlowCollector<T>) {}
|
||||
^
|
||||
/kt51464.kt:12:15: warning: type parameter for a type argument R can't be inferred into declared upper bounds. Please provide any use-site type information. It will become an error in future releases.
|
||||
flowOf(1).transform { doEmit(this) }
|
||||
^
|
||||
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
fun <T> flowOf(value: T): Flow<T> = TODO()
|
||||
|
||||
interface FlowCollector<in T> {}
|
||||
|
||||
interface Flow<out T>
|
||||
|
||||
fun <T, R> Flow<T>.transform(transform: FlowCollector<R>.(T) -> Unit): Flow<R> = TODO()
|
||||
|
||||
fun f() {
|
||||
fun <T> doEmit(collector: FlowCollector<T>) {}
|
||||
flowOf(1).<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>transform<!> { doEmit(this) }
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
fun <T> flowOf(value: T): Flow<T> = TODO()
|
||||
|
||||
@@ -10,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).<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>transform<!> { doEmit(this) }
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@ data class InputWrapper<TItem>(val value: TItem)
|
||||
data class Output(val source: InputWrapper<List<String>>)
|
||||
|
||||
fun main2(input: InputWrapper<Unit>): Output {
|
||||
val output = input.doMapping(
|
||||
val output = input.<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>doMapping<!>(
|
||||
foo = { buildList { add("this is List<String>") } },
|
||||
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>bar = { it.isNotEmpty() }<!>,
|
||||
)
|
||||
|
||||
return Output(source = output)
|
||||
return Output(source = <!TYPE_MISMATCH!>output<!>)
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ fun <T> List<T>.myGenericExt() {}
|
||||
fun <R> a(first: R, second: (List<R>) -> Unit) {}
|
||||
|
||||
fun test1() {
|
||||
a(
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!>(
|
||||
buildList { add("") },
|
||||
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION("R; a")!>second = {
|
||||
it.myGenericExt()
|
||||
@@ -67,4 +67,4 @@ fun test4() {
|
||||
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION("D; buildPartList")!>left = { add(1) }<!>,
|
||||
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION("D; buildPartList")!>right = { add("") }<!>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
compiler/testData/diagnostics/tests/inference/builderInference/multiLambdaRestrictionDisabled.fir.kt
Vendored
+71
@@ -0,0 +1,71 @@
|
||||
// WITH_STDLIB
|
||||
// LANGUAGE: +NoBuilderInferenceWithoutAnnotationRestriction
|
||||
// SKIP_TXT
|
||||
|
||||
fun List<Int>.myExt() {}
|
||||
fun <T> List<T>.myGenericExt() {}
|
||||
|
||||
fun <R> a(first: R, second: (List<R>) -> Unit) {}
|
||||
|
||||
fun test1() {
|
||||
a(
|
||||
buildList { add("") },
|
||||
second = {
|
||||
it.myGenericExt()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
fun <R> b(first: () -> List<R>, second: (List<R>) -> Unit) {}
|
||||
|
||||
fun test2() {
|
||||
b(
|
||||
first = {
|
||||
buildList { add("") }
|
||||
},
|
||||
second = {
|
||||
it.myExt() // Note: must be extension to add constraints
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun <Q> select(a: Q, b: Q): Q = a
|
||||
|
||||
// Note: no builder inference annotation
|
||||
fun <R> myBuildList(builder: MutableList<R>.() -> Unit): List<R> {
|
||||
val list = mutableListOf<R>()
|
||||
list.builder()
|
||||
return list
|
||||
}
|
||||
|
||||
fun test3() {
|
||||
select(
|
||||
buildList { add("") },
|
||||
buildList { add(1) }
|
||||
)
|
||||
|
||||
select (
|
||||
myBuildList { add("") },
|
||||
myBuildList { add(1) },
|
||||
)
|
||||
|
||||
select (
|
||||
run { myBuildList { add("") } },
|
||||
myBuildList { add(1) },
|
||||
)
|
||||
}
|
||||
|
||||
fun <D> buildPartList(left: MutableList<D>.() -> Unit, right: MutableList<D>.() -> Unit): List<D> {
|
||||
val list = mutableListOf<D>()
|
||||
list.left()
|
||||
list.right()
|
||||
return list
|
||||
}
|
||||
|
||||
fun test4() {
|
||||
buildPartList(
|
||||
left = { add(1) },
|
||||
right = { add("") }
|
||||
)
|
||||
}
|
||||
Vendored
+2
-3
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_STDLIB
|
||||
// LANGUAGE: +NoBuilderInferenceWithoutAnnotationRestriction
|
||||
// SKIP_TXT
|
||||
@@ -9,7 +8,7 @@ fun <T> List<T>.myGenericExt() {}
|
||||
fun <R> a(first: R, second: (List<R>) -> Unit) {}
|
||||
|
||||
fun test1() {
|
||||
a(
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!>(
|
||||
buildList { add("") },
|
||||
second = {
|
||||
it.myGenericExt()
|
||||
@@ -69,4 +68,4 @@ fun test4() {
|
||||
left = { add(1) },
|
||||
right = { add("") }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -36,10 +36,10 @@ fun main() {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>capture(<!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.String>")!>getOut()<!>)<!>
|
||||
""
|
||||
}
|
||||
build {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>build<!> {
|
||||
emit("")
|
||||
// K is fixed into CapturedType(in NotFixed: TypeVariable(R))
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>capture(<!DEBUG_INFO_EXPRESSION_TYPE("Inv<in kotlin.Any?>")!>getIn()<!>)<!>
|
||||
""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -42,7 +42,7 @@ fun test() {
|
||||
<!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 {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>build2<!> {
|
||||
emit(1)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select(this@build.get(), get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select(Test.foo(this@build.get()), Test.foo(get()))<!>
|
||||
|
||||
compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeCovariant.kt
Vendored
+1
-1
@@ -53,7 +53,7 @@ fun test() {
|
||||
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select4(id(Test.foo(get())), getOut())<!>
|
||||
|
||||
build2 {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>build2<!> {
|
||||
emit(1)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select1(this@build.get(), getOut())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select1(get(), Test.foo(this@build.getOut()))<!>
|
||||
|
||||
Vendored
+2
-2
@@ -45,7 +45,7 @@ fun test() {
|
||||
<!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 {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>build2<!> {
|
||||
emit(1)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select(this@build.get(), get())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select(Test.foo(this@build.get()), Test.foo(get()))<!>
|
||||
@@ -67,7 +67,7 @@ fun test() {
|
||||
<!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 {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>build2<!> {
|
||||
emit(1)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select(this@build.get(), get(), null)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select(Test.foo(this@build.get()), Test.foo(get()), null)<!>
|
||||
|
||||
+6
-6
@@ -8,7 +8,7 @@ fun <T> T.extension() {}
|
||||
fun use(p: Any?) {}
|
||||
|
||||
fun test1() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>a<!> {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER("R; a")!>this.get(0)<!>.extension()
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER("R; a")!>this.get(0)<!>::extension)
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER("R; a")!>it<!>::extension)
|
||||
@@ -17,7 +17,7 @@ fun test1() {
|
||||
|
||||
|
||||
fun test2() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>a<!> {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
val v = this.get(0)
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER("R; a")!>v<!>.extension()
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER("R; a")!>v<!>::extension)
|
||||
@@ -27,7 +27,7 @@ fun test2() {
|
||||
|
||||
fun test3() {
|
||||
operator fun <T> T.getValue(thisRef: Any?, prop: Any?): T = this
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>a<!> {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
val v by <!BUILDER_INFERENCE_STUB_RECEIVER("R; a")!>this.get(0)<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER("R; a")!>v<!>.extension()
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER("R; a")!>v<!>::extension)
|
||||
@@ -40,7 +40,7 @@ class Box<TIn>(val t: TIn)
|
||||
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<!> {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
val v by <!BUILDER_INFERENCE_STUB_RECEIVER("R; a")!>this.get(0)<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER("R; a")!>v<!>.extension()
|
||||
use(<!BUILDER_INFERENCE_STUB_RECEIVER("R; a")!>v<!>::extension)
|
||||
@@ -53,7 +53,7 @@ fun <R> b(lambda: R.(List<R>) -> Unit) {}
|
||||
fun test5() {
|
||||
|
||||
operator fun <T> T.invoke(): T = this
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>b<!> {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>b<!> {
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER("R; b")!>extension()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER("R; b")!><!BUILDER_INFERENCE_STUB_RECEIVER("R; b")!>this<!>()<!>.extension()
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER("R; b")!>use(::extension)<!>
|
||||
@@ -63,7 +63,7 @@ fun test5() {
|
||||
val <T> T.genericLambda: T.((T) -> Unit) -> Unit get() = {}
|
||||
|
||||
fun test6() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>b<!> {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>b<!> {
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER("R; b")!>extension()<!>
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER("R; b")!>genericLambda<!> { }
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER("R; b")!>genericLambda<!> { <!BUILDER_INFERENCE_STUB_RECEIVER("R; b")!>it<!>.extension() }
|
||||
|
||||
+6
-6
@@ -9,7 +9,7 @@ fun <T> T.extension() {}
|
||||
fun use(p: Any?) {}
|
||||
|
||||
fun test1() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>a<!> {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
this.get(0).extension()
|
||||
use(this.get(0)::extension)
|
||||
use(it::extension)
|
||||
@@ -18,7 +18,7 @@ fun test1() {
|
||||
|
||||
|
||||
fun test2() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>a<!> {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
val v = this.get(0)
|
||||
v.extension()
|
||||
use(v::extension)
|
||||
@@ -28,7 +28,7 @@ fun test2() {
|
||||
|
||||
fun test3() {
|
||||
operator fun <T> T.getValue(thisRef: Any?, prop: Any?): T = this
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>a<!> {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
val v by this.get(0)
|
||||
v.extension()
|
||||
use(v::extension)
|
||||
@@ -41,7 +41,7 @@ class Box<TIn>(val t: TIn)
|
||||
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<!> {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
val v by this.get(0)
|
||||
v.extension()
|
||||
use(v::extension)
|
||||
@@ -54,7 +54,7 @@ fun <R> b(lambda: R.(List<R>) -> Unit) {}
|
||||
fun test5() {
|
||||
|
||||
operator fun <T> T.invoke(): T = this
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>b<!> {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>b<!> {
|
||||
extension()
|
||||
this().extension()
|
||||
use(::extension)
|
||||
@@ -64,7 +64,7 @@ fun test5() {
|
||||
val <T> T.genericLambda: T.((T) -> Unit) -> Unit get() = {}
|
||||
|
||||
fun test6() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>b<!> {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>b<!> {
|
||||
extension()
|
||||
genericLambda { }
|
||||
genericLambda { it.extension() }
|
||||
|
||||
@@ -266,7 +266,6 @@ enum class LanguageFeature(
|
||||
ReportTypeVarianceConflictOnQualifierArguments(KOTLIN_1_9, kind = BUG_FIX), // KT-50947
|
||||
ReportErrorsOnRecursiveTypeInsidePlusAssignment(KOTLIN_1_9, kind = BUG_FIX), // KT-48546
|
||||
ForbidExtensionCallsOnInlineFunctionalParameters(KOTLIN_1_9, kind = BUG_FIX), // KT-52502
|
||||
ForbidInferringPostponedTypeVariableIntoDeclaredUpperBound(KOTLIN_1_9, kind = BUG_FIX), // KT-47986
|
||||
KeepNullabilityWhenApproximatingLocalType(KOTLIN_1_9, kind = BUG_FIX), // KT-53982
|
||||
SkipStandaloneScriptsInSourceRoots(KOTLIN_1_9, kind = OTHER), // KT-52525
|
||||
ModifierNonBuiltinSuspendFunError(KOTLIN_1_9, kind = BUG_FIX), // KT-49264
|
||||
@@ -286,6 +285,7 @@ enum class LanguageFeature(
|
||||
EnhanceNullabilityOfPrimitiveArrays(KOTLIN_2_0, kind = BUG_FIX), // KT-54521
|
||||
AllowEmptyIntersectionsInResultTypeResolver(KOTLIN_2_0, kind = OTHER), // KT-51221
|
||||
ProhibitSmartcastsOnPropertyFromAlienBaseClassInheritedInInvisibleClass(KOTLIN_2_0, kind = BUG_FIX), // KT-57290
|
||||
ForbidInferringPostponedTypeVariableIntoDeclaredUpperBound(KOTLIN_2_0, kind = BUG_FIX), // KT-47986
|
||||
|
||||
// End of 2.* language features --------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user