From 34d408eb7b582a941f78785237b3c5450d808edf Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Thu, 11 Dec 2014 12:04:40 +0300 Subject: [PATCH] Simple workaround for problem described in KT-6437 JS backend generate invalid code when inlining within constructor using property --- js/js.translator/testData/webDemoExamples2/cases/life.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/js.translator/testData/webDemoExamples2/cases/life.kt b/js/js.translator/testData/webDemoExamples2/cases/life.kt index cb9a1c8528b..3222ab45a45 100644 --- a/js/js.translator/testData/webDemoExamples2/cases/life.kt +++ b/js/js.translator/testData/webDemoExamples2/cases/life.kt @@ -16,7 +16,10 @@ class Field( // if init(i, j) is true, the cell (i, j) is alive init: (Int, Int) -> Boolean ) { - private val live: Array> = Array(height) { i -> Array(width) { j -> init(i, j) } } + private val live: Array> + { + live = Array(height) { i -> Array(width) { j -> init(i, j) } } + } private fun liveCount(i: Int, j: Int) = if (i in 0..height - 1 &&