Update tests after switching to LV 1.9
This commit is contained in:
committed by
Space Team
parent
66544a4e00
commit
88efa6bfb6
+2
-10
@@ -1,12 +1,4 @@
|
||||
/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.
|
||||
/kt47986Default.kt:10:13: error: not enough information to infer type variable K
|
||||
val x = buildFoo {
|
||||
^
|
||||
|
||||
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
// !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()
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
class Foo<K>
|
||||
|
||||
@@ -6,7 +7,7 @@ fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
|
||||
fun <K> Foo<K>.bar(x: Int = 1) {}
|
||||
|
||||
fun main() {
|
||||
val x = <!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>buildFoo<!> {
|
||||
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> {
|
||||
bar()
|
||||
}
|
||||
}
|
||||
|
||||
+2
-10
@@ -1,12 +1,4 @@
|
||||
/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.
|
||||
/kt47986_2.kt:12:13: error: not enough information to infer type variable K
|
||||
val x = buildFoo { // can't infer
|
||||
^
|
||||
/kt47986_2.kt:12:13: warning: variable 'y' is never used
|
||||
val y = id(::bar)
|
||||
^
|
||||
|
||||
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
// !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)
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
class Foo<K>
|
||||
|
||||
@@ -8,7 +9,7 @@ fun <L> Foo<L>.bar() {}
|
||||
fun <K> id(x: K) = x
|
||||
|
||||
fun main() {
|
||||
val x = <!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>buildFoo<!> { // can't infer
|
||||
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> { // can't infer
|
||||
val y = id(::bar)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-10
@@ -1,12 +1,4 @@
|
||||
/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.
|
||||
/kt47986_3.kt:10:13: error: not enough information to infer type variable K
|
||||
val x = buildFoo {
|
||||
^
|
||||
|
||||
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
// !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()
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
class Foo<K>
|
||||
|
||||
@@ -6,7 +7,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 = <!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>buildFoo<!> {
|
||||
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> {
|
||||
bar()
|
||||
}
|
||||
}
|
||||
|
||||
+2
-10
@@ -1,12 +1,4 @@
|
||||
/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.
|
||||
/kt51464.kt:13:15: error: not enough information to infer type variable R
|
||||
flowOf(1).transform { doEmit(this) }
|
||||
^
|
||||
|
||||
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
// !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,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
fun <T> flowOf(value: T): Flow<T> = TODO()
|
||||
|
||||
@@ -9,5 +10,5 @@ fun <T, R> Flow<T>.transform(transform: FlowCollector<R>.(T) -> Unit): Flow<R> =
|
||||
|
||||
fun f() {
|
||||
fun <T> doEmit(collector: FlowCollector<T>) {}
|
||||
flowOf(1).<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>transform<!> { doEmit(this) }
|
||||
}
|
||||
flowOf(1).<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>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.<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>doMapping<!>(
|
||||
val output = input.doMapping(
|
||||
foo = { buildList { add("this is List<String>") } },
|
||||
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>bar = { it.isNotEmpty() }<!>,
|
||||
)
|
||||
|
||||
return Output(source = <!TYPE_MISMATCH!>output<!>)
|
||||
return Output(source = output)
|
||||
}
|
||||
|
||||
+7
-7
@@ -8,7 +8,7 @@ fun <T> T.extension() {}
|
||||
fun use(p: Any?) {}
|
||||
|
||||
fun test1() {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>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() {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>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
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>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
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>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
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>b<!> {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>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,10 +63,10 @@ fun test5() {
|
||||
val <T> T.genericLambda: T.((T) -> Unit) -> Unit get() = {}
|
||||
|
||||
fun test6() {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>b<!> {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>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() }
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER("R; b")!>use(::extension)<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -9,7 +9,7 @@ fun <T> T.extension() {}
|
||||
fun use(p: Any?) {}
|
||||
|
||||
fun test1() {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>a<!> {
|
||||
this.get(0).extension()
|
||||
use(this.get(0)::extension)
|
||||
use(it::extension)
|
||||
@@ -18,7 +18,7 @@ fun test1() {
|
||||
|
||||
|
||||
fun test2() {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>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
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>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
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>a<!> {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>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
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>b<!> {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>b<!> {
|
||||
extension()
|
||||
this().extension()
|
||||
use(::extension)
|
||||
@@ -64,10 +64,10 @@ fun test5() {
|
||||
val <T> T.genericLambda: T.((T) -> Unit) -> Unit get() = {}
|
||||
|
||||
fun test6() {
|
||||
<!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>b<!> {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>b<!> {
|
||||
extension()
|
||||
genericLambda { }
|
||||
genericLambda { it.extension() }
|
||||
use(::extension)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ fun test3() = <!INFERRED_TYPE_VARIABLE_INTO_POSSIBLE_EMPTY_INTERSECTION!>run<!>
|
||||
incompatibleI() // ? either uninferred T or error (Unit </: I)
|
||||
}
|
||||
|
||||
fun test4() = <!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>run<!> {
|
||||
fun test4() = <!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>run<!> {
|
||||
if (p) return@run
|
||||
incompatibleC() // ? either uninferred T or error (Unit </: C)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -47,7 +47,7 @@ fun test(i: Inv<Nothing>, iUnit: Inv<Unit>) {
|
||||
|
||||
if (iUnit is <!INCOMPATIBLE_TYPES!>String<!>) {
|
||||
launch {
|
||||
run(A.<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>flexible<!>(iUnit)) { 42 }
|
||||
run(A.<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>flexible<!>(iUnit)) { 42 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ object OnlyOne {
|
||||
fun <T : Comparable<T>, S : T> greater(x: Bar<in S>, t: T) {}
|
||||
|
||||
fun test(b: Bar<Long>) {
|
||||
<!DEBUG_INFO_CALL("fqName: OnlyOne.greater; typeCall: function")!><!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>greater<!>(b, b)<!>
|
||||
<!DEBUG_INFO_CALL("fqName: OnlyOne.greater; typeCall: function")!><!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>greater<!>(b, b)<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,4 +34,4 @@ object GoodOldCandidate {
|
||||
<!DEBUG_INFO_CALL("fqName: GoodOldCandidate.Nested.greater; typeCall: function")!>greater(b, b)<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-4
@@ -1,6 +1,3 @@
|
||||
/kt45461.kt:5:25: warning: parameter 'foo' is never used
|
||||
fun <S : T> takeFoo(foo: Foo<in S>) {}
|
||||
^
|
||||
/kt45461.kt:10:19: warning: type argument for a type parameter S can't be inferred because it has incompatible upper bounds: String, Int (multiple incompatible classes). This will become an error in Kotlin 1.9
|
||||
/kt45461.kt:10:19: error: type argument for a type parameter S can't be inferred because it has incompatible upper bounds: String, Int (multiple incompatible classes)
|
||||
Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
|
||||
^
|
||||
|
||||
+2
-2
@@ -7,5 +7,5 @@ class Bar<T> {
|
||||
|
||||
fun main() {
|
||||
val foo = Foo<Int>()
|
||||
Bar<String>().<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>takeFoo<!>(foo) // error in 1.3.72, no error in 1.4.31
|
||||
}
|
||||
Bar<String>().<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>takeFoo<!>(foo) // error in 1.3.72, no error in 1.4.31
|
||||
}
|
||||
|
||||
+1
-4
@@ -1,7 +1,4 @@
|
||||
/kt45461_12.kt:5:25: warning: parameter 'foo' is never used
|
||||
fun <S : T> takeFoo(foo: Foo<in S>) {}
|
||||
^
|
||||
/kt45461_12.kt:12:19: warning: type argument for a type parameter S can't be inferred because it has incompatible upper bounds: String, K (multiple incompatible classes: String, Number). This will become an error in Kotlin 1.9
|
||||
/kt45461_12.kt:12:19: error: type argument for a type parameter S can't be inferred because it has incompatible upper bounds: String, K (multiple incompatible classes: String, Number)
|
||||
Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
|
||||
^
|
||||
|
||||
|
||||
+1
-1
@@ -9,5 +9,5 @@ interface A
|
||||
|
||||
fun <K : L, L : N, N> main() where N: A, N: Number {
|
||||
val foo = Foo<K>()
|
||||
Bar<String>().<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>takeFoo<!>(foo) // error in 1.3.72, no error in 1.4.31
|
||||
Bar<String>().<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>takeFoo<!>(foo) // error in 1.3.72, no error in 1.4.31
|
||||
}
|
||||
|
||||
+1
-7
@@ -1,10 +1,4 @@
|
||||
/kt45461_2.kt:5:25: warning: parameter 'foo' is never used
|
||||
fun <S : T> takeFoo(foo: Foo<in S>) {}
|
||||
^
|
||||
/kt45461_2.kt:8:10: warning: 'Int' is a final type, and thus a value of the type parameter is predetermined
|
||||
fun <K : Int> main() {
|
||||
^
|
||||
/kt45461_2.kt:10:19: warning: type argument for a type parameter S can't be inferred because it has incompatible upper bounds: String, K (multiple incompatible classes: String, Int). This will become an error in Kotlin 1.9
|
||||
/kt45461_2.kt:10:19: error: type argument for a type parameter S can't be inferred because it has incompatible upper bounds: String, K (multiple incompatible classes: String, Int)
|
||||
Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
|
||||
^
|
||||
|
||||
|
||||
+2
-2
@@ -7,5 +7,5 @@ class Bar<T> {
|
||||
|
||||
fun <K : <!FINAL_UPPER_BOUND!>Int<!>> main() {
|
||||
val foo = Foo<K>()
|
||||
Bar<String>().<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>takeFoo<!>(foo) // error in 1.3.72, no error in 1.4.31
|
||||
}
|
||||
Bar<String>().<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>takeFoo<!>(foo) // error in 1.3.72, no error in 1.4.31
|
||||
}
|
||||
|
||||
+1
-4
@@ -1,6 +1,3 @@
|
||||
/kt45461_5.kt:5:25: warning: parameter 'foo' is never used
|
||||
fun <S : T> takeFoo(foo: Foo<in S>) {}
|
||||
^
|
||||
/kt45461_5.kt:10:19: warning: type argument for a type parameter S can't be inferred because it has incompatible upper bounds: String, K (multiple incompatible classes: String, Number). This will become an error in Kotlin 1.9
|
||||
/kt45461_5.kt:10:19: error: type argument for a type parameter S can't be inferred because it has incompatible upper bounds: String, K (multiple incompatible classes: String, Number)
|
||||
Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
|
||||
^
|
||||
|
||||
+1
-1
@@ -7,5 +7,5 @@ class Bar<T> {
|
||||
|
||||
fun <K : L, L : N, N: Number> main() {
|
||||
val foo = Foo<K>()
|
||||
Bar<String>().<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>takeFoo<!>(foo) // error in 1.3.72, no error in 1.4.31
|
||||
Bar<String>().<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>takeFoo<!>(foo) // error in 1.3.72, no error in 1.4.31
|
||||
}
|
||||
|
||||
+1
-13
@@ -1,16 +1,4 @@
|
||||
/kt48765.kt:4:44: warning: parameter 'x1' is never used
|
||||
fun <T1: Number, T2: A<Float, T1>> foo(x1: T2, x2: T1) {}
|
||||
^
|
||||
/kt48765.kt:4:52: warning: parameter 'x2' is never used
|
||||
fun <T1: Number, T2: A<Float, T1>> foo(x1: T2, x2: T1) {}
|
||||
^
|
||||
/kt48765.kt:8:13: warning: type argument for a type parameter T can't be inferred because it has incompatible upper bounds: String, Number (multiple incompatible classes). This will become an error in Kotlin 1.9
|
||||
/kt48765.kt:8:13: error: type argument for a type parameter T can't be inferred because it has incompatible upper bounds: String, Number (multiple incompatible classes)
|
||||
B().foo(x, foo())
|
||||
^
|
||||
/kt48765.kt:12:9: warning: 'String' is a final type, and thus a value of the type parameter is predetermined
|
||||
fun <T: String> foo(): T {
|
||||
^
|
||||
/kt48765.kt:13:15: warning: unchecked cast: String to T
|
||||
return "" as T // this cast is safe because String is final.
|
||||
^
|
||||
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ class B {
|
||||
}
|
||||
class C<T: D, T2>(val x: T, val y: T2) {
|
||||
fun test() {
|
||||
B().<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>foo<!>(x, foo())
|
||||
B().<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>foo<!>(x, foo())
|
||||
}
|
||||
}
|
||||
open class D: A<Float, Number>()
|
||||
@@ -14,4 +14,4 @@ fun <T: <!FINAL_UPPER_BOUND!>String<!>> foo(): T {
|
||||
}
|
||||
fun main() {
|
||||
C(D(), 10.5).test()
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,5 +7,5 @@ fun <T, V> exampleGenericFunction(func: V) where T: Base, V: (T) -> Unit {
|
||||
|
||||
fun main() {
|
||||
val func: (DoesNotImplementBase) -> Unit = { }
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>exampleGenericFunction<!>(func) // expected this to be a compilation error as the T: Base constraint should not be satisfied
|
||||
}
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>exampleGenericFunction<!>(func) // expected this to be a compilation error as the T: Base constraint should not be satisfied
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,5 +7,5 @@ fun <T, V> exampleGenericFunction(func: V) where T: Base, V: (T) -> Unit {
|
||||
|
||||
fun main() {
|
||||
val func: (DoesNotImplementBase) -> Unit = { }
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>exampleGenericFunction<!>(func) // expected this to be a compilation error as the T: Base constraint should not be satisfied
|
||||
}
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>exampleGenericFunction<!>(func) // expected this to be a compilation error as the T: Base constraint should not be satisfied
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ fun box(): String {
|
||||
return try {
|
||||
val range1 = 0..1
|
||||
range1 <!CAST_NEVER_SUCCEEDS!>as<!> List<Double>
|
||||
<!DEBUG_INFO_SMARTCAST!>range1<!>.<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>joinToString<!> { "" }
|
||||
<!DEBUG_INFO_SMARTCAST!>range1<!>.<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>joinToString<!> { "" }
|
||||
} catch (e: java.lang.ClassCastException) {
|
||||
"OK"
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/kt49661.kt:10:5: warning: type argument for a type parameter T can't be inferred because it has incompatible upper bounds: Foo, Int (multiple incompatible classes). This will become an error in Kotlin 1.9
|
||||
/kt49661.kt:10:5: error: type argument for a type parameter T can't be inferred because it has incompatible upper bounds: Foo, Int (multiple incompatible classes)
|
||||
f<Int> { g() }
|
||||
^
|
||||
|
||||
|
||||
+2
-2
@@ -7,5 +7,5 @@ inline fun <R> f(block: ()->R?): R? {
|
||||
}
|
||||
|
||||
fun main() {
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>f<!><Int> { g() }
|
||||
}
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>f<!><Int> { g() }
|
||||
}
|
||||
|
||||
+2
-2
@@ -12,6 +12,6 @@ fun main() {
|
||||
// val number: Long = 5 // works
|
||||
|
||||
with (WrapperFunctions()) {
|
||||
wrapper <!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>greaterEq<!> number
|
||||
wrapper <!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>greaterEq<!> number
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,5 +9,5 @@ infix fun <T : Comparable<T>, S : T?> ExpressionWithColumnType<in S>.less(t: T)
|
||||
infix fun <T : Comparable<T>, S : T?> Expression<in S>.less(other: Expression<in S>) {}
|
||||
|
||||
fun main(x: Column<Long?>, y: Double) {
|
||||
x <!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>less<!> y // error in 1.7.20, no error in 1.7.0
|
||||
x <!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>less<!> y // error in 1.7.20, no error in 1.7.0
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -3,5 +3,5 @@ fun <T : <!FINAL_UPPER_BOUND!>String<!>> g(): T? = null
|
||||
fun <R> f(block: () -> R?): R? = block()
|
||||
|
||||
fun main() {
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>f<!><Int> { g() /* OK, g() is inferred into {Int & String}? */ }
|
||||
}
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>f<!><Int> { g() /* OK, g() is inferred into {Int & String}? */ }
|
||||
}
|
||||
|
||||
+1
-10
@@ -1,12 +1,3 @@
|
||||
/selectFromCovariantAndContravariantTypes.kt:10:22: warning: parameter 'y' is never used
|
||||
fun <K> select(x: K, y: K): K = x
|
||||
^
|
||||
/selectFromCovariantAndContravariantTypes.kt:11:19: warning: parameter 'x' is never used
|
||||
fun <V> genericIn(x: In<V>) {}
|
||||
^
|
||||
/selectFromCovariantAndContravariantTypes.kt:12:20: warning: parameter 'x' is never used
|
||||
fun <V> genericOut(x: Out<V>) {}
|
||||
^
|
||||
/selectFromCovariantAndContravariantTypes.kt:15:5: warning: type argument for a type parameter V can't be inferred because it has incompatible upper bounds: A, B (multiple incompatible classes). This will become an error in Kotlin 1.9
|
||||
/selectFromCovariantAndContravariantTypes.kt:15:5: error: type argument for a type parameter V can't be inferred because it has incompatible upper bounds: A, B (multiple incompatible classes)
|
||||
genericIn(select(a, b))
|
||||
^
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ fun <V> genericIn(x: In<V>) {}
|
||||
fun <V> genericOut(x: Out<V>) {}
|
||||
|
||||
fun test1(a: In<A>, b: In<B>) {
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>genericIn<!>(select(a, b))
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_ERROR!>genericIn<!>(select(a, b))
|
||||
}
|
||||
|
||||
fun test2(a: Out<A>, b: Out<B>) {
|
||||
|
||||
Reference in New Issue
Block a user