mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-27 00:21:29 +00:00
[FIR2IR] Use only data class primary constructor parameters for equals
This commit is contained in:
committed by
Mikhail Glukhikh
parent
0890b8bad3
commit
ef8bcceb8e
@@ -119,7 +119,11 @@ class DataClassMembersGenerator(val components: Fir2IrComponents) {
|
||||
(this.name == toStringName && matchesToStringSignature)
|
||||
|
||||
fun generate(klass: FirClass<*>): List<Name> {
|
||||
val properties = irClass.declarations.filterIsInstance<IrProperty>().map { it.descriptor }
|
||||
val propertyParametersCount = irClass.primaryConstructor?.explicitParameters?.size ?: 0
|
||||
val properties = irClass.declarations
|
||||
.filterIsInstance<IrProperty>()
|
||||
.take(propertyParametersCount)
|
||||
.map { it.descriptor }
|
||||
if (properties.isEmpty()) {
|
||||
return emptyList()
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
internal data class A1(val prop1: String) {
|
||||
val prop2: String = "const2"
|
||||
var prop3: String = ""
|
||||
|
||||
Reference in New Issue
Block a user