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:
Dmitry Jemerov
2015-01-30 14:05:25 +01:00
parent 0e7d7ac709
commit 6442b61db8
4 changed files with 38 additions and 3 deletions
@@ -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