Maintain proper evaluation order for 'a in x .. y'
As of Kotlin 1.0 and 1.1, expression 'a in x .. y' is considered equivalent to 'x.rangeTo(y).a', and should be evaluated in the following order: 1. x 2. y 3. a 4. compare x with a 5. compare y with a (if needed)
This commit is contained in:
@@ -13177,6 +13177,30 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/contains"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("evaluationOrderForCollection.kt")
|
||||
public void testEvaluationOrderForCollection() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/contains/evaluationOrderForCollection.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("evaluationOrderForComparableRange.kt")
|
||||
public void testEvaluationOrderForComparableRange() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/contains/evaluationOrderForComparableRange.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("evaluationOrderForDownTo.kt")
|
||||
public void testEvaluationOrderForDownTo() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/contains/evaluationOrderForDownTo.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("evaluationOrderForRangeLiteral.kt")
|
||||
public void testEvaluationOrderForRangeLiteral() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/contains/evaluationOrderForRangeLiteral.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("inArray.kt")
|
||||
public void testInArray() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/contains/inArray.kt");
|
||||
|
||||
Reference in New Issue
Block a user