[FE] Support resolve of until operator to rangeUntil

^KT-52420 Fixed
This commit is contained in:
Victor Petukhov
2022-05-23 14:54:56 +02:00
committed by teamcity
parent 19136019e4
commit 0b25ce4de9
14 changed files with 136 additions and 0 deletions
@@ -22343,6 +22343,28 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
public void testPlusAssignOnVarAndCollections() throws Exception {
runTest("compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnVarAndCollections.kt");
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/operatorsOverloading/until")
@TestDataPath("$PROJECT_ROOT")
public class Until {
@Test
public void testAllFilesPresentInUntil() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/operatorsOverloading/until"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("custom.kt")
public void testCustom() throws Exception {
runTest("compiler/testData/diagnostics/tests/operatorsOverloading/until/custom.kt");
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/diagnostics/tests/operatorsOverloading/until/simple.kt");
}
}
}
@Nested
@@ -22343,6 +22343,28 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
public void testPlusAssignOnVarAndCollections() throws Exception {
runTest("compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnVarAndCollections.kt");
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/operatorsOverloading/until")
@TestDataPath("$PROJECT_ROOT")
public class Until {
@Test
public void testAllFilesPresentInUntil() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/operatorsOverloading/until"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("custom.kt")
public void testCustom() throws Exception {
runTest("compiler/testData/diagnostics/tests/operatorsOverloading/until/custom.kt");
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/diagnostics/tests/operatorsOverloading/until/simple.kt");
}
}
}
@Nested
@@ -49,6 +49,7 @@ import org.jetbrains.kotlin.util.OperatorNameConventions.ITERATOR
import org.jetbrains.kotlin.util.OperatorNameConventions.NEXT
import org.jetbrains.kotlin.util.OperatorNameConventions.PROVIDE_DELEGATE
import org.jetbrains.kotlin.util.OperatorNameConventions.RANGE_TO
import org.jetbrains.kotlin.util.OperatorNameConventions.RANGE_UNTIL
import org.jetbrains.kotlin.util.OperatorNameConventions.SET
import org.jetbrains.kotlin.util.OperatorNameConventions.SET_VALUE
import org.jetbrains.kotlin.util.OperatorNameConventions.SIMPLE_UNARY_OPERATION_NAMES
@@ -179,6 +180,7 @@ private object OperatorFunctionChecks {
checkFor(NEXT, memberOrExtension, ValueParametersCount.none)
checkFor(HAS_NEXT, memberOrExtension, ValueParametersCount.none, Returns.boolean)
checkFor(RANGE_TO, memberOrExtension, ValueParametersCount.single, noDefaultAndVarargs)
checkFor(RANGE_UNTIL, memberOrExtension, ValueParametersCount.single, noDefaultAndVarargs)
checkFor(
EQUALS,
member,