PSI2IR KT-41284 use getters for open data class property values

'allopen' compiler plug-in can make data classes and their members open,
which is a compilation error in usual case, but makes sense for Spring
and other frameworks that generate proxy-classes.
This commit is contained in:
Dmitry Petrov
2020-12-08 17:13:39 +03:00
parent d8d30263d3
commit 69c88a8a0a
15 changed files with 503 additions and 30 deletions
@@ -0,0 +1,8 @@
data class Test(
val x: String,
val y: String
)
// 7 GETFIELD Test\.x
// 7 GETFIELD Test\.y
// - get, componentN, copy$default, toString, hashCode, 2 times in equals
@@ -0,0 +1,14 @@
// This test emulates 'allopen' compiler plugin.
@Suppress("INCOMPATIBLE_MODIFIERS")
open data class Test(
open val x: String,
open val y: String
)
// 1 GETFIELD Test\.x
// 1 GETFIELD Test\.y
// 6 INVOKEVIRTUAL Test\.getX
// 6 INVOKEVIRTUAL Test\.getY
// - componentN, copy$default, toString, hashCode, 2 times in equals