[FE] Introduce warnings on possible empty intersection types, and improve errors reporting in general

^KT-52361 Fixed
This commit is contained in:
Victor Petukhov
2022-05-23 10:10:59 +02:00
committed by teamcity
parent e133ee3765
commit 6a34b184ac
53 changed files with 501 additions and 335 deletions
@@ -13,7 +13,7 @@ fun testElvis(a: Int?, b: Int?) {
if (a != null) {
doInt(b ?: <!DEBUG_INFO_SMARTCAST!>a<!>)
}
doList(getList() ?: emptyListOfA()) //should be an error
<!INFERRED_TYPE_VARIABLE_INTO_POSSIBLE_EMPTY_INTERSECTION("")!>doList<!>(getList() ?: emptyListOfA()) //should be an error
doList(getList() ?: strangeList { doInt(it) }) //lambda was not analyzed
}