backend: Fix enum constructor default parameters

The problem was observed in the follwing code:

enum class A(one: Int, val two: Int = one) ...

The problem is in the `two` default value. Here the enum constructor
lowering used an old (not lowered) symbol for `one`. Also the lowering
didn't copy the default expression for DEFAULT class.
The patch fixes both problems.
This commit is contained in:
Ilya Matveev
2017-06-09 19:20:54 +07:00
committed by ilmat192
parent e64a5f42f0
commit 07c8404a5e
3 changed files with 37 additions and 12 deletions
@@ -0,0 +1,7 @@
enum class A(one: Int, val two: Int = one) {
FOO(42)
}
fun main(args: Array<String>) {
println(A.FOO.two)
}