Don't generate redundant initializers for 'var' properties.
Since only 'val' properties store initializers as compile time constants in descriptors, we need to take the initializer expression from the PSI and try to evaluate it as a constant. #KT-6661 fixed
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package a
|
||||
|
||||
class A {
|
||||
private var x: String? = null
|
||||
}
|
||||
|
||||
// 0 PUTFIELD
|
||||
@@ -0,0 +1,7 @@
|
||||
package a
|
||||
|
||||
class A {
|
||||
private var x: Int = 0
|
||||
}
|
||||
|
||||
// 0 PUTFIELD
|
||||
Reference in New Issue
Block a user