Support of custom 'equals' and 'hashCode' in inline classes

'equals' from any made available for overriding in inline classes
'typed' equals made available for definition in inline classes
'typed' equals definition made compulsory if 'untyped' is overridden
'operator' keyword is allowed in 'typed' equals definition

^KT-24874: Fixed
This commit is contained in:
vladislav.grechko
2022-10-04 20:22:11 +02:00
committed by teamcity
parent 527e8dde27
commit e0c8142106
47 changed files with 684 additions and 53 deletions
@@ -17860,6 +17860,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/inlineClasses/identityComparisonWithInlineClasses.kt");
}
@Test
@TestMetadata("illegalEqualsOverridingInInlineClass.kt")
public void testIllegalEqualsOverridingInInlineClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/inlineClasses/illegalEqualsOverridingInInlineClass.kt");
}
@Test
@TestMetadata("inlineClassCanImplementInterfaceByDelegation.kt")
public void testInlineClassCanImplementInterfaceByDelegation() throws Exception {
@@ -17968,6 +17974,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/inlineClasses/synchronizedForbidden.kt");
}
@Test
@TestMetadata("typedEqualsOperatorModifierInInlineClass.kt")
public void testTypedEqualsOperatorModifierInInlineClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/inlineClasses/typedEqualsOperatorModifierInInlineClass.kt");
}
@Test
@TestMetadata("unsignedLiteralsWithoutArtifactOnClasspath.kt")
public void testUnsignedLiteralsWithoutArtifactOnClasspath() throws Exception {
@@ -20705,6 +20705,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvokeGeneric.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
}
@Test
@TestMetadata("inlineClassHashCodeOverride.kt")
public void testInlineClassHashCodeOverride() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassHashCodeOverride.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
}
@Test
@TestMetadata("inlineClassImplementsCollection.kt")
public void testInlineClassImplementsCollection() throws Exception {
@@ -21353,6 +21353,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambdaGeneric.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
}
@Test
@TestMetadata("inlineClassBothEqualsOverride.kt")
public void testInlineClassBothEqualsOverride() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassBothEqualsOverride.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
}
@Test
@TestMetadata("inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt")
public void testInlineClassEqualityShouldUseTotalOrderForFloatingPointData() throws Exception {
@@ -21365,6 +21371,24 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointDataGeneric.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
}
@Test
@TestMetadata("inlineClassEqualsConsistency.kt")
public void testInlineClassEqualsConsistency() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualsConsistency.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
}
@Test
@TestMetadata("inlineClassEqualsOverride.kt")
public void testInlineClassEqualsOverride() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualsOverride.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
}
@Test
@TestMetadata("inlineClassEqualsOverridenForCollections.kt")
public void testInlineClassEqualsOverridenForCollections() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualsOverridenForCollections.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
}
@Test
@TestMetadata("inlineClassFieldHandling.kt")
public void testInlineClassFieldHandling() throws Exception {
@@ -21389,6 +21413,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvokeGeneric.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
}
@Test
@TestMetadata("inlineClassHashCodeOverride.kt")
public void testInlineClassHashCodeOverride() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassHashCodeOverride.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
}
@Test
@TestMetadata("inlineClassImplementsCollection.kt")
public void testInlineClassImplementsCollection() throws Exception {
@@ -21437,6 +21467,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassPropertyReferenceGetAndSetGeneric.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
}
@Test
@TestMetadata("inlineClassUntypedEqualsOverriden.kt")
public void testInlineClassUntypedEqualsOverriden() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassUntypedEqualsOverriden.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
}
@Test
@TestMetadata("inlineClassValueCapturedInInlineLambda.kt")
public void testInlineClassValueCapturedInInlineLambda() throws Exception {