FIR: Implement data class constructor checker

This commit is contained in:
Tianyu Geng
2021-02-23 20:42:34 -08:00
committed by Mikhail Glukhikh
parent d2da15e039
commit 6e8bad6ef6
21 changed files with 160 additions and 69 deletions
@@ -1,4 +1,4 @@
data class A {}
<!PRIMARY_CONSTRUCTOR_REQUIRED_FOR_DATA_CLASS!>data class A {}<!>
<!PRIMARY_CONSTRUCTOR_REQUIRED_FOR_DATA_CLASS!>data class B {
constructor()
@@ -1,5 +1,5 @@
// ISSUE: KT-44554
data class Foo(a: Int, val b: Int) {
data class Foo(<!DATA_CLASS_NOT_PROPERTY_PARAMETER!>a: Int<!>, val b: Int) {
val c = 4
}
@@ -4,7 +4,7 @@
private sealed class Sealed
private data class SubClass1(val t: String) : Sealed()
private data class SubClass2 : Sealed()
<!PRIMARY_CONSTRUCTOR_REQUIRED_FOR_DATA_CLASS!>private data class SubClass2 : Sealed()<!>
private fun foo(p: Sealed) {
when (p) {