K2: support ForbidInferringTypeVariablesIntoEmptyIntersection on/off
This commit is contained in:
committed by
Space Team
parent
f7544aff62
commit
b64cb67370
@@ -1,12 +0,0 @@
|
||||
class Expression<T>(val x: T)
|
||||
|
||||
class GreaterOp(val expr1: Expression<*>, val expr2: Expression<*>)
|
||||
|
||||
fun <T : Comparable<T>, S : T?> Expression<in S>.greater(other: T): GreaterOp =
|
||||
GreaterOp(this, Expression(other))
|
||||
|
||||
fun foo(countExpr: Expression<Long>) {
|
||||
countExpr.greater(0)
|
||||
countExpr.<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION!>greater<!>("0")
|
||||
countExpr.greater<String, Nothing>("0")
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
class Expression<T>(val x: T)
|
||||
|
||||
class GreaterOp(val expr1: Expression<*>, val expr2: Expression<*>)
|
||||
|
||||
compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotation.fir.kt
Vendored
+1
-1
@@ -7,5 +7,5 @@ fun test1(l: List<Number>) {
|
||||
|
||||
val i: Int = l.firstTyped()
|
||||
|
||||
val s: String = l.<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION!>firstTyped<!>()
|
||||
val s: String = l.<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>firstTyped<!>()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user