[FIR] Implement NULL_FOR_NONNULL_TYPE diagnostics, fix tests

This commit is contained in:
Ivan Kochurkin
2021-04-13 20:17:48 +03:00
parent 9336e4b09b
commit 4353365968
54 changed files with 130 additions and 251 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ fun foo(expr: StringBuilder): Int {
fun unitShort() : Unit = Unit
fun unitShortConv() : Unit = <error descr="[RETURN_TYPE_MISMATCH] Return type mismatch: expected kotlin/Unit, actual kotlin/Int">1</error>
fun unitShortNull() : Unit = <error descr="[RETURN_TYPE_MISMATCH] Return type mismatch: expected kotlin/Unit, actual kotlin/Nothing?">null</error>
fun unitShortNull() : Unit = <error descr="[NULL_FOR_NONNULL_TYPE] ">null</error>
fun intEmpty() : Int {}
fun intShortInfer() = 1
+2 -2
View File
@@ -3,8 +3,8 @@ package test
annotation class A(val value: String)
@A(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/Nothing? but kotlin/String was expected">null</error>)
@A(<error descr="[NULL_FOR_NONNULL_TYPE] ">null</error>)
fun foo() {}
@A(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/Nothing? but kotlin/String was expected">null</error>)
@A(<error descr="[NULL_FOR_NONNULL_TYPE] ">null</error>)
class B