KT-10322, KT-10646, KT-10647:

- update diagnostic to (supposedly) more useful
- also report IMPLICIT_CAST_TO_ANY if expected type is DONT_CARE
 (effectively "no expected type" for lambda expression).
This commit is contained in:
Dmitry Petrov
2016-01-13 19:31:23 +03:00
parent f54de08073
commit 609ffc10a9
15 changed files with 118 additions and 40 deletions
@@ -1,6 +1,6 @@
val test1 = { <!IMPLICIT_CAST_TO_UNIT_OR_ANY!>if (true) 1 else ""<!> }
val test1 = { if (true) <!IMPLICIT_CAST_TO_ANY!>1<!> else <!IMPLICIT_CAST_TO_ANY!>""<!> }
val test2 = { { <!IMPLICIT_CAST_TO_UNIT_OR_ANY!>if (true) 1 else ""<!> } }
val test2 = { { if (true) <!IMPLICIT_CAST_TO_ANY!>1<!> else <!IMPLICIT_CAST_TO_ANY!>""<!> } }
val test3: (Boolean) -> Any = { if (it) 1 else "" }