NI: avoid creating useless captured types during incorporation

^KT-37546 Fixed
This commit is contained in:
Victor Petukhov
2020-03-17 12:17:22 +03:00
parent e34dd27a34
commit ea59ea8aa2
7 changed files with 2337 additions and 31 deletions
@@ -6,5 +6,5 @@ FILE: definetelyNotNullForTypeParameter.kt
}
public final fun <F : R|kotlin/Any|> foo(computable: R|Out<F?>|): R|kotlin/Unit|
public final fun <T : R|kotlin/Any|> bar(computable: R|Out<T?>|): R|kotlin/Unit| {
R|/foo|<R|T?!!|>(R|/id|<R|T?|>(R|<local>/computable|))
R|/foo|<R|T|>(R|/id|<R|T?|>(R|<local>/computable|))
}
@@ -10278,6 +10278,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/approximateBeforeFixation.kt");
}
@TestMetadata("avoidCreatingUselessCapturedTypes.kt")
public void testAvoidCreatingUselessCapturedTypes() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/avoidCreatingUselessCapturedTypes.kt");
}
@TestMetadata("cannotCaptureInProjection.kt")
public void testCannotCaptureInProjection() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/cannotCaptureInProjection.kt");