[FIR] Add 3 type mismatch diagnostics

This commit is contained in:
Nick
2020-08-12 14:45:57 +03:00
parent c8f8908a01
commit 61e21dadec
27 changed files with 736 additions and 114 deletions
@@ -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>) {