JVM IR: lookup symbols by name in ProgressionHandlers in known classes only

Alternatively, we could improve the lookup utilities and their usages to
always find the exact override of a symbol from
Collection/Iterable/CharSequence/etc, but since we need to load the
original symbol anyway in cases when the loop subject's type is a type
parameter, we might as well simplify everything and always reference the
original symbol.

Also improve exception message and removed unused declarations in
IrBackendUtils.kt.
This commit is contained in:
Alexander Udalov
2019-11-29 13:15:12 +01:00
parent 359e49fa02
commit 025360edc4
16 changed files with 221 additions and 39 deletions
@@ -15196,6 +15196,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/ranges/forInCharSequenceWithMultipleGetFunctions.kt");
}
@TestMetadata("forInCustomCharSequence.kt")
public void testForInCustomCharSequence() throws Exception {
runTest("compiler/testData/codegen/box/ranges/forInCustomCharSequence.kt");
}
@TestMetadata("forInCustomIterable.kt")
public void testForInCustomIterable() throws Exception {
runTest("compiler/testData/codegen/box/ranges/forInCustomIterable.kt");
}
@TestMetadata("forInRangeLiteralWithMixedTypeBounds.kt")
public void testForInRangeLiteralWithMixedTypeBounds() throws Exception {
runTest("compiler/testData/codegen/box/ranges/forInRangeLiteralWithMixedTypeBounds.kt");
@@ -15925,6 +15935,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/forInIndices"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
}
@TestMetadata("forInArrayListIndices.kt")
public void testForInArrayListIndices() throws Exception {
runTest("compiler/testData/codegen/box/ranges/forInIndices/forInArrayListIndices.kt");
}
@TestMetadata("forInCharSequenceIndices.kt")
public void testForInCharSequenceIndices() throws Exception {
runTest("compiler/testData/codegen/box/ranges/forInIndices/forInCharSequenceIndices.kt");
@@ -16376,6 +16376,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/ranges/forInCharSequenceWithMultipleGetFunctions.kt");
}
@TestMetadata("forInCustomCharSequence.kt")
public void testForInCustomCharSequence() throws Exception {
runTest("compiler/testData/codegen/box/ranges/forInCustomCharSequence.kt");
}
@TestMetadata("forInCustomIterable.kt")
public void testForInCustomIterable() throws Exception {
runTest("compiler/testData/codegen/box/ranges/forInCustomIterable.kt");
}
@TestMetadata("forInRangeLiteralWithMixedTypeBounds.kt")
public void testForInRangeLiteralWithMixedTypeBounds() throws Exception {
runTest("compiler/testData/codegen/box/ranges/forInRangeLiteralWithMixedTypeBounds.kt");
@@ -17105,6 +17115,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/forInIndices"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
}
@TestMetadata("forInArrayListIndices.kt")
public void testForInArrayListIndices() throws Exception {
runTest("compiler/testData/codegen/box/ranges/forInIndices/forInArrayListIndices.kt");
}
@TestMetadata("forInCharSequenceIndices.kt")
public void testForInCharSequenceIndices() throws Exception {
runTest("compiler/testData/codegen/box/ranges/forInIndices/forInCharSequenceIndices.kt");