[FIR] Fix generating data class if there is non-property in primary constructor
#KT-44554 Fixed
This commit is contained in:
committed by
TeamCityServer
parent
30b5bfe767
commit
2b088f1147
+5
@@ -244,6 +244,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/implicitTypeInFakeOverride.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("incorrectDataClass.kt")
|
||||
public void testIncorrectDataClass() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/incorrectDataClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("incorrectSuperCall.kt")
|
||||
public void testIncorrectSuperCall() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/incorrectSuperCall.kt");
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
FILE: incorrectDataClass.kt
|
||||
public final data class Foo : R|kotlin/Any| {
|
||||
public constructor(a: R|kotlin/Int|, b: R|kotlin/Int|): R|Foo| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val b: R|kotlin/Int| = R|<local>/b|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
public final val c: R|kotlin/Int| = Int(4)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
public final operator fun component1(): R|kotlin/Int|
|
||||
|
||||
public final fun copy(b: R|kotlin/Int| = this@R|/Foo|.R|/Foo.b|): R|Foo|
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// ISSUE: KT-44554
|
||||
|
||||
data class Foo(a: Int, val b: Int) {
|
||||
val c = 4
|
||||
}
|
||||
+6
@@ -284,6 +284,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/implicitTypeInFakeOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("incorrectDataClass.kt")
|
||||
public void testIncorrectDataClass() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/incorrectDataClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("incorrectSuperCall.kt")
|
||||
public void testIncorrectSuperCall() throws Exception {
|
||||
|
||||
+6
@@ -287,6 +287,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/implicitTypeInFakeOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("incorrectDataClass.kt")
|
||||
public void testIncorrectDataClass() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/incorrectDataClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("incorrectSuperCall.kt")
|
||||
public void testIncorrectSuperCall() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user