[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:
Generated
+5
@@ -10371,6 +10371,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
|
||||
runTest("compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("coersionWithAnonymousFunctionsAndUnresolved.kt")
|
||||
public void testCoersionWithAnonymousFunctionsAndUnresolved() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/coercionToUnit/coersionWithAnonymousFunctionsAndUnresolved.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("indirectCoercionWithExpectedType.kt")
|
||||
public void testIndirectCoercionWithExpectedType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.kt");
|
||||
|
||||
Reference in New Issue
Block a user