Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/greater.fir.kt
T
2022-02-17 15:04:36 +00:00

13 lines
383 B
Kotlin
Vendored

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>) {
<!NEW_INFERENCE_ERROR!>countExpr.greater(0)<!>
countExpr.greater("0")
countExpr.greater<String, Nothing>("0")
}