Fix resolve of last destructuring declaration in block

Last declaration in block is resolved in DEPENDENT mode because it has
 influence on return type and therefore fake call for destructuring declaration
 wasn't completed (see `getBlockReturnedTypeWithWritableScope`)

 Now we resolve fake call for destructuring declaration in INDEPENDENT
 mode as it doesn't have effect on return type

 #KT-15480 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-05-04 15:12:21 +03:00
parent 7530a9426f
commit adb8e60615
5 changed files with 52 additions and 3 deletions
@@ -5652,6 +5652,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("lastDestructuringDeclarationInBlock.kt")
public void testLastDestructuringDeclarationInBlock() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/lastDestructuringDeclarationInBlock.kt");
doTest(fileName);
}
@TestMetadata("RedeclarationInForLoop.kt")
public void testRedeclarationInForLoop() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/RedeclarationInForLoop.kt");