Correctly map container element type in intrinsic for withIndex

In case of arrays, we couldn't distinguish array of boxed Ints
from array of primitive Ints.

 #KT-22904 Fixed Target versions 1.2.40
This commit is contained in:
Dmitry Petrov
2018-02-19 14:53:36 +03:00
parent 2028ec3ce8
commit 99cea07bf4
14 changed files with 321 additions and 5 deletions
@@ -5240,12 +5240,48 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("forInByteArrayWithIndexWithSmartCast.kt")
public void testForInByteArrayWithIndexWithSmartCast() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInByteArrayWithIndexWithSmartCast.kt");
doTest(fileName);
}
@TestMetadata("forInByteArrrayWithIndex.kt")
public void testForInByteArrrayWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInByteArrrayWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInEmptyArrrayWithIndex.kt")
public void testForInEmptyArrrayWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInEmptyArrrayWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInGenericArrayOfIntsWithIndex.kt")
public void testForInGenericArrayOfIntsWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInGenericArrayOfIntsWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInGenericArrayOfIntsWithIndexWithSmartCast.kt")
public void testForInGenericArrayOfIntsWithIndexWithSmartCast() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInGenericArrayOfIntsWithIndexWithSmartCast.kt");
doTest(fileName);
}
@TestMetadata("forInGenericArrayWithIndex.kt")
public void testForInGenericArrayWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInGenericArrayWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInIntArrayWithIndexWithSmartCast.kt")
public void testForInIntArrayWithIndexWithSmartCast() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInIntArrayWithIndexWithSmartCast.kt");
doTest(fileName);
}
@TestMetadata("forInIntArrrayWithIndex.kt")
public void testForInIntArrrayWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInIntArrrayWithIndex.kt");
@@ -5257,6 +5293,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInObjectArrrayWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInShortArrayWithIndexWithSmartCast.kt")
public void testForInShortArrayWithIndexWithSmartCast() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInShortArrayWithIndexWithSmartCast.kt");
doTest(fileName);
}
@TestMetadata("forInShortArrrayWithIndex.kt")
public void testForInShortArrrayWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInShortArrrayWithIndex.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex")
@@ -5240,12 +5240,48 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
doTest(fileName);
}
@TestMetadata("forInByteArrayWithIndexWithSmartCast.kt")
public void testForInByteArrayWithIndexWithSmartCast() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInByteArrayWithIndexWithSmartCast.kt");
doTest(fileName);
}
@TestMetadata("forInByteArrrayWithIndex.kt")
public void testForInByteArrrayWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInByteArrrayWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInEmptyArrrayWithIndex.kt")
public void testForInEmptyArrrayWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInEmptyArrrayWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInGenericArrayOfIntsWithIndex.kt")
public void testForInGenericArrayOfIntsWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInGenericArrayOfIntsWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInGenericArrayOfIntsWithIndexWithSmartCast.kt")
public void testForInGenericArrayOfIntsWithIndexWithSmartCast() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInGenericArrayOfIntsWithIndexWithSmartCast.kt");
doTest(fileName);
}
@TestMetadata("forInGenericArrayWithIndex.kt")
public void testForInGenericArrayWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInGenericArrayWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInIntArrayWithIndexWithSmartCast.kt")
public void testForInIntArrayWithIndexWithSmartCast() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInIntArrayWithIndexWithSmartCast.kt");
doTest(fileName);
}
@TestMetadata("forInIntArrrayWithIndex.kt")
public void testForInIntArrrayWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInIntArrrayWithIndex.kt");
@@ -5257,6 +5293,18 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInObjectArrrayWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInShortArrayWithIndexWithSmartCast.kt")
public void testForInShortArrayWithIndexWithSmartCast() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInShortArrayWithIndexWithSmartCast.kt");
doTest(fileName);
}
@TestMetadata("forInShortArrrayWithIndex.kt")
public void testForInShortArrrayWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInShortArrrayWithIndex.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex")