Implement proper expression generation for the last script line

fixes problem with result fields
#KT-33127 fixed
This commit is contained in:
Ilya Chernikov
2019-08-06 06:34:34 +02:00
parent ec54246b3a
commit cddabf140b
2 changed files with 22 additions and 2 deletions
@@ -55,6 +55,20 @@ class ReplTest : TestCase() {
)
}
@Test
fun testEvalWithIfResult() {
chechEvaluateInRepl(
simpleScriptompilationConfiguration,
simpleScriptEvaluationConfiguration,
sequenceOf(
"val x = 5",
"x + 6",
"if (x < 10) res1 * 2 else x"
),
sequenceOf(null, 11, 22)
)
}
@Test
fun testImplicitReceiver() {
val receiver = TestReceiver()