Do not allow compareTo() to return Int?
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class C {
|
||||
fun compareTo(c: C): Int? = null
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c <!COMPARE_TO_TYPE_MISMATCH!><<!> c
|
||||
c <!COMPARE_TO_TYPE_MISMATCH!><=<!> c
|
||||
c <!COMPARE_TO_TYPE_MISMATCH!>>=<!> c
|
||||
c <!COMPARE_TO_TYPE_MISMATCH!>><!> c
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package
|
||||
|
||||
internal fun test(/*0*/ c: C): kotlin.Unit
|
||||
|
||||
internal final class C {
|
||||
public constructor C()
|
||||
internal final fun compareTo(/*0*/ c: C): kotlin.Int?
|
||||
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