K2: Added test for data class metadata
#KT-57622 Fixed
This commit is contained in:
committed by
Space Team
parent
f48142a6e6
commit
f67f8c393b
+6
@@ -13745,6 +13745,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
||||
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromOtherModule.kt")
|
||||
public void testFromOtherModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericParam.kt")
|
||||
public void testGenericParam() throws Exception {
|
||||
|
||||
+6
@@ -13745,6 +13745,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
||||
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromOtherModule.kt")
|
||||
public void testFromOtherModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericParam.kt")
|
||||
public void testGenericParam() throws Exception {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
// MODULE: lib
|
||||
// FILE: lib.kt
|
||||
|
||||
data class D(val x: Int)
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: main.kt
|
||||
|
||||
fun box() : String {
|
||||
val a = D(1)
|
||||
val b = D(2)
|
||||
val c = D(1)
|
||||
|
||||
if (a == b) return "FAIL 1"
|
||||
if (a != c) return "FAIL 2"
|
||||
if (!a.equals(c)) return "FAIL 3"
|
||||
if (a.hashCode() != c.hashCode()) return "FAIL 4"
|
||||
return "OK"
|
||||
}
|
||||
+6
@@ -13421,6 +13421,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromOtherModule.kt")
|
||||
public void testFromOtherModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericParam.kt")
|
||||
public void testGenericParam() throws Exception {
|
||||
|
||||
+6
@@ -13745,6 +13745,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromOtherModule.kt")
|
||||
public void testFromOtherModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericParam.kt")
|
||||
public void testGenericParam() throws Exception {
|
||||
|
||||
+6
@@ -13745,6 +13745,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
|
||||
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromOtherModule.kt")
|
||||
public void testFromOtherModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericParam.kt")
|
||||
public void testGenericParam() throws Exception {
|
||||
|
||||
+5
@@ -10901,6 +10901,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("fromOtherModule.kt")
|
||||
public void testFromOtherModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericParam.kt")
|
||||
public void testGenericParam() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/genericParam.kt");
|
||||
|
||||
+6
@@ -9989,6 +9989,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromOtherModule.kt")
|
||||
public void testFromOtherModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericParam.kt")
|
||||
public void testGenericParam() throws Exception {
|
||||
|
||||
+6
@@ -10085,6 +10085,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromOtherModule.kt")
|
||||
public void testFromOtherModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericParam.kt")
|
||||
public void testGenericParam() throws Exception {
|
||||
|
||||
+6
@@ -10085,6 +10085,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromOtherModule.kt")
|
||||
public void testFromOtherModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericParam.kt")
|
||||
public void testGenericParam() throws Exception {
|
||||
|
||||
+6
@@ -10085,6 +10085,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
|
||||
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromOtherModule.kt")
|
||||
public void testFromOtherModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericParam.kt")
|
||||
public void testGenericParam() throws Exception {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
// MUTED_WHEN: K1
|
||||
package test
|
||||
|
||||
data class DataClass(
|
||||
val intProp: Int,
|
||||
val stringProp: String
|
||||
) {
|
||||
val nonConstructorProp: Int = 0
|
||||
}
|
||||
|
||||
data object DataObject
|
||||
@@ -0,0 +1,16 @@
|
||||
data class DataClass constructor(intProp: Int, stringProp: String) {
|
||||
val intProp: Int
|
||||
val nonConstructorProp: Int = 0
|
||||
val stringProp: String
|
||||
operator fun component1(): Int
|
||||
operator fun component2(): String
|
||||
fun copy(intProp: Int = ..., stringProp: String = ...): DataClass
|
||||
override fun equals(other: Any?): Boolean
|
||||
override fun hashCode(): Int
|
||||
override fun toString(): String
|
||||
}
|
||||
data object DataObject {
|
||||
override fun equals(other: Any?): Boolean
|
||||
override fun hashCode(): Int
|
||||
override fun toString(): String
|
||||
}
|
||||
+6
@@ -11119,6 +11119,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
|
||||
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromOtherModule.kt")
|
||||
public void testFromOtherModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericParam.kt")
|
||||
public void testGenericParam() throws Exception {
|
||||
|
||||
+6
@@ -11371,6 +11371,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
|
||||
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromOtherModule.kt")
|
||||
public void testFromOtherModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericParam.kt")
|
||||
public void testGenericParam() throws Exception {
|
||||
|
||||
+6
@@ -40,6 +40,12 @@ public class FirNativeKLibContentsTestGenerated extends AbstractNativeKlibConten
|
||||
runTest("native/native.tests/testData/klibContents/annotations_source_retention.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("data_class.kt")
|
||||
public void testData_class() throws Exception {
|
||||
runTest("native/native.tests/testData/klibContents/data_class.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55464_serializeTypeAnnotation.kt")
|
||||
public void testKt55464_serializeTypeAnnotation() throws Exception {
|
||||
|
||||
+6
@@ -10994,6 +10994,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromOtherModule.kt")
|
||||
public void testFromOtherModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericParam.kt")
|
||||
public void testGenericParam() throws Exception {
|
||||
|
||||
+6
@@ -11120,6 +11120,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
|
||||
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromOtherModule.kt")
|
||||
public void testFromOtherModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericParam.kt")
|
||||
public void testGenericParam() throws Exception {
|
||||
|
||||
+6
@@ -36,6 +36,12 @@ public class NativeKLibContentsTestGenerated extends AbstractNativeKlibContentsT
|
||||
runTest("native/native.tests/testData/klibContents/annotations_source_retention.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("data_class.kt")
|
||||
public void testData_class() throws Exception {
|
||||
runTest("native/native.tests/testData/klibContents/data_class.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55464_serializeTypeAnnotation.kt")
|
||||
public void testKt55464_serializeTypeAnnotation() throws Exception {
|
||||
|
||||
Generated
+5
@@ -8916,6 +8916,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("fromOtherModule.kt")
|
||||
public void testFromOtherModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericParam.kt")
|
||||
public void testGenericParam() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/dataClasses/genericParam.kt");
|
||||
|
||||
Reference in New Issue
Block a user