[K1, K2, CLI] Mark whole position range of compiler diagnostics in CLI

#KT-64989
This commit is contained in:
Evgeniy.Zhelenskiy
2024-01-15 21:36:56 +01:00
committed by Space Team
parent 5b11308d1b
commit 7eab4b672d
278 changed files with 929 additions and 907 deletions
@@ -1,4 +1,4 @@
/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 {
^
^^^^^^^^
@@ -1,4 +1,4 @@
/kt47986Disabled.kt:10: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 {
^
^^^^^^^^
@@ -1,4 +1,4 @@
/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
^
^^^^^^^^
@@ -1,4 +1,4 @@
/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 {
^
^^^^^^^^
@@ -1,4 +1,4 @@
/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) }
^
^^^^^^^^^
@@ -1,4 +1,4 @@
/kt45461.kt:12: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 2.0
Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
^
^^^^^^^
@@ -1,4 +1,4 @@
/kt45461_12.kt:14: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 2.0
Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
^
^^^^^^^
@@ -1,7 +1,7 @@
/kt45461_2.kt:10:10: warning: 'Int' is a final type, and thus a value of the type parameter is predetermined
fun <K : Int> main() {
^
^^^
/kt45461_2.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, Int). This will become an error in Kotlin 2.0
Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
^
^^^^^^^
@@ -1,10 +1,10 @@
/kt45461_25.kt:11:20: error: type mismatch: inferred type is {K & String} but Float was expected
val x: Float = Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
^
^^^^^^^^^^^^^^^^^^^^^^^^^^
/kt45461_25.kt:11:34: 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)
val x: Float = Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
^
^^^^^^^
/kt45461_25.kt:11:34: error: type mismatch: inferred type is {K & String} but Float was expected
val x: Float = Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
^
^^^^^^^
@@ -1,6 +1,7 @@
/kt45461_26.kt:13:25: error: type mismatch: inferred type is {K & Out<String>} but Out<Float> was expected
val x: Out<Float> = Bar<Out<String>>().takeFoo(foo)
^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/kt45461_26.kt:13:44: error: type mismatch: inferred type is {K & Out<String>} but Out<Float> was expected
val x: Out<Float> = Bar<Out<String>>().takeFoo(foo)
^
^^^^^^^
@@ -1,4 +1,4 @@
/kt45461_5.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 2.0
Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
^
^^^^^^^
@@ -1,10 +1,10 @@
/kt48765.kt:10: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 2.0
B().foo(x, foo())
^
^^^
/kt48765.kt:14:9: warning: 'String' is a final type, and thus a value of the type parameter is predetermined
fun <T: String> foo(): T {
^
^^^^^^
/kt48765.kt:15:15: warning: unchecked cast: String to T
return "" as T // this cast is safe because String is final.
^
^^^^
@@ -1,4 +1,4 @@
/kt48935.kt:13:5: warning: type argument for a type parameter T has possible incompatible upper bounds: Base, DoesNotImplementBase (final class and interface)
exampleGenericFunction(func) // expected this to be a compilation error as the T: Base constraint should not be satisfied
^
^^^^^^^^^^^^^^^^^^^^^^
@@ -1,4 +1,4 @@
/selectFromCovariantAndContravariantTypes.kt:17: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 2.0
genericIn(select(a, b))
^
^^^^^^^^^