FIR: add test for KT-51357
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
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")
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
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.greater("0")
|
||||
countExpr.greater<String, Nothing>("0")
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ countExpr: Expression<kotlin.Long>): kotlin.Unit
|
||||
public fun </*0*/ T : kotlin.Comparable<T>, /*1*/ S : T?> Expression<in S>.greater(/*0*/ other: T): GreaterOp
|
||||
|
||||
public final class Expression</*0*/ T> {
|
||||
public constructor Expression</*0*/ T>(/*0*/ x: T)
|
||||
public final val x: T
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class GreaterOp {
|
||||
public constructor GreaterOp(/*0*/ expr1: Expression<*>, /*1*/ expr2: Expression<*>)
|
||||
public final val expr1: Expression<*>
|
||||
public final val expr2: Expression<*>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user