[FIR] Add 3 type mismatch diagnostics
This commit is contained in:
+10
-1
@@ -11,7 +11,16 @@ import java.util.*;
|
||||
|
||||
abstract class B : MutableList<Int>, AbstractList<Int>() {
|
||||
override fun removeAt(index: Int): Int = null!!
|
||||
override fun remove(element: Int): Boolean = null!!
|
||||
override fun remove(element: Int): <!RETURN_TYPE_MISMATCH_ON_OVERRIDE!>Boolean<!> = null!!
|
||||
}
|
||||
|
||||
abstract class D : AbstractList<Int>() {
|
||||
// removeAt() doesn't exist in java/util/AbstractList, it's a
|
||||
// fake override of the method from kotlin/collections/MutableList
|
||||
override fun removeAt(index: Int): Int = null!!
|
||||
// AbstractList::remove() should return Int here. No fake overrides created.
|
||||
// This may be a bug because the old compiler doesn't report a diagnostic here.
|
||||
override fun remove(element: Int): <!RETURN_TYPE_MISMATCH_ON_OVERRIDE!>Boolean<!> = null!!
|
||||
}
|
||||
|
||||
fun main(a: A, b: B, c: ArrayList<Int>) {
|
||||
|
||||
Reference in New Issue
Block a user