[NI] Remove lambda coersion to Unit in case of error return type(s)
Coersion to Unit from error type leads to misleading type mismatches: "expected <expected lambda return type> found Unit", despite no user-provided Unit / empty lambda. These diagnostics were collected, but not reported before, and that had been disguising the issue for a while. KT-34729 Fixed
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ fun text() {
|
||||
bar1 {1}
|
||||
bar1 {it + 1}
|
||||
|
||||
bar2 {<!TYPE_MISMATCH!><!>}
|
||||
bar2 <!NI;TYPE_MISMATCH!>{<!TYPE_MISMATCH!><!>}<!>
|
||||
bar2 {1}
|
||||
bar2 {<!UNRESOLVED_REFERENCE!>it<!>}
|
||||
bar2 <!NI;TYPE_MISMATCH!>{<!CANNOT_INFER_PARAMETER_TYPE, EXPECTED_PARAMETERS_NUMBER_MISMATCH!>it<!> -> <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>it<!>}<!>
|
||||
|
||||
Reference in New Issue
Block a user