Disable ForbidInferringTypeVariablesIntoEmptyIntersection in some FE tests
This commit is contained in:
committed by
Space Team
parent
b64cb67370
commit
d9a6cad5ab
+1
@@ -1,4 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ForbidInferringTypeVariablesIntoEmptyIntersection
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
abstract class Foo<T>
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/kt45461.kt:5:25: warning: parameter 'foo' is never used
|
||||
/kt45461.kt:7: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 2.0
|
||||
/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 a future release
|
||||
Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
|
||||
^
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ForbidInferringTypeVariablesIntoEmptyIntersection
|
||||
// RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
class Foo<T>
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
/kt45461_12.kt:5:25: warning: parameter 'foo' is never used
|
||||
/kt45461_12.kt:7: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 2.0
|
||||
/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 a future release
|
||||
Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
|
||||
^
|
||||
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ForbidInferringTypeVariablesIntoEmptyIntersection
|
||||
// RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
class Foo<T>
|
||||
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
/kt45461_2.kt:5:25: warning: parameter 'foo' is never used
|
||||
/kt45461_2.kt:7: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
|
||||
/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: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 2.0
|
||||
/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 a future release
|
||||
Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
|
||||
^
|
||||
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ForbidInferringTypeVariablesIntoEmptyIntersection
|
||||
// RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
class Foo<T>
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/kt45461_5.kt:5:25: warning: parameter 'foo' is never used
|
||||
/kt45461_5.kt:7: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 2.0
|
||||
/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 a future release
|
||||
Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
|
||||
^
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ForbidInferringTypeVariablesIntoEmptyIntersection
|
||||
// RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
class Foo<T>
|
||||
|
||||
|
||||
+5
-5
@@ -1,16 +1,16 @@
|
||||
/kt48765.kt:4:44: warning: parameter 'x1' is never used
|
||||
/kt48765.kt:6: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
|
||||
/kt48765.kt:6: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 2.0
|
||||
/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 a future release
|
||||
B().foo(x, foo())
|
||||
^
|
||||
/kt48765.kt:12:9: warning: 'String' is a final type, and thus a value of the type parameter is predetermined
|
||||
/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:13:15: warning: unchecked cast: String to T
|
||||
/kt48765.kt:15:15: warning: unchecked cast: String to T
|
||||
return "" as T // this cast is safe because String is final.
|
||||
^
|
||||
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ForbidInferringTypeVariablesIntoEmptyIntersection
|
||||
// RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
open class A<T1, T2> {}
|
||||
class B {
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ForbidInferringTypeVariablesIntoEmptyIntersection
|
||||
open class Base
|
||||
open class DoesNotImplementBase
|
||||
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ForbidInferringTypeVariablesIntoEmptyIntersection
|
||||
open class Base
|
||||
class DoesNotImplementBase
|
||||
|
||||
|
||||
+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 2.0
|
||||
/kt49661.kt:12: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 a future release
|
||||
f<Int> { g() }
|
||||
^
|
||||
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ForbidInferringTypeVariablesIntoEmptyIntersection
|
||||
// RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
open class Foo
|
||||
inline fun <reified T : Foo> g(): T? = null
|
||||
|
||||
Vendored
+1
@@ -1,4 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ForbidInferringTypeVariablesIntoEmptyIntersection
|
||||
fun <T : <!FINAL_UPPER_BOUND!>String<!>> g(): T? = null
|
||||
|
||||
fun <R> f(block: () -> R?): R? = block()
|
||||
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
/selectFromCovariantAndContravariantTypes.kt:10:22: warning: parameter 'y' is never used
|
||||
/selectFromCovariantAndContravariantTypes.kt:12: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
|
||||
/selectFromCovariantAndContravariantTypes.kt:13:19: warning: parameter 'x' is never used
|
||||
fun <V> genericIn(x: In<V>) {}
|
||||
^
|
||||
/selectFromCovariantAndContravariantTypes.kt:12:20: warning: parameter 'x' is never used
|
||||
/selectFromCovariantAndContravariantTypes.kt:14: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 2.0
|
||||
/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 a future release
|
||||
genericIn(select(a, b))
|
||||
^
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ForbidInferringTypeVariablesIntoEmptyIntersection
|
||||
// RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
|
||||
Reference in New Issue
Block a user