Fix false positive "Cannot capture" error reporting
There is no need to report an error in case of non-top-level capture conversion, just don't add relevant capture type in the system instead If system can be solved successfully without captured type, then it's just fine (see KT-13950) In case of contradiction TYPE_INFERENCE_PARAMETER_CONSTRAINT_ERROR is reported #KT-13950 Fixed
This commit is contained in:
@@ -9389,6 +9389,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("noCaptureTypeErrorForNonTopLevel.kt")
|
||||
public void testNoCaptureTypeErrorForNonTopLevel() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/inference/capturedTypes/noCaptureTypeErrorForNonTopLevel.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("notApproximateWhenCopyDescriptors.kt")
|
||||
public void testNotApproximateWhenCopyDescriptors() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/inference/capturedTypes/notApproximateWhenCopyDescriptors.kt");
|
||||
|
||||
Reference in New Issue
Block a user