diff --git a/compiler/testData/codegen/script/adder.kts b/compiler/testData/codegen/script/adder.kts new file mode 100644 index 00000000000..0b1ae95f498 --- /dev/null +++ b/compiler/testData/codegen/script/adder.kts @@ -0,0 +1,5 @@ +var x = 0 +x++ +x++ +x++ +// expected: x: 3 diff --git a/compiler/testData/codegen/script/empty.kts b/compiler/testData/codegen/script/empty.kts index 1378a17d91c..0ab9f98a841 100644 --- a/compiler/testData/codegen/script/empty.kts +++ b/compiler/testData/codegen/script/empty.kts @@ -1,2 +1 @@ - -// expected: rv: null +// expected: rv: diff --git a/compiler/testData/codegen/script/helloWorld.kts b/compiler/testData/codegen/script/helloWorld.kts index e6a15b33c53..0be3522e03c 100644 --- a/compiler/testData/codegen/script/helloWorld.kts +++ b/compiler/testData/codegen/script/helloWorld.kts @@ -1,2 +1,2 @@ -// expected: rv: null -System.out!!.println("hello world") +// expected: rv: +System.out!!.println("hello world") \ No newline at end of file diff --git a/compiler/testData/codegen/script/inline.kts b/compiler/testData/codegen/script/inline.kts index b341b9d8339..5546642c5c3 100644 --- a/compiler/testData/codegen/script/inline.kts +++ b/compiler/testData/codegen/script/inline.kts @@ -11,4 +11,4 @@ fun main(): Int { return foo { x -> bar(x) } } -main() \ No newline at end of file +val rv = main() \ No newline at end of file diff --git a/compiler/testData/codegen/script/outerCapture.kts b/compiler/testData/codegen/script/outerCapture.kts index ab5b9e9520a..3e24f798e5a 100644 --- a/compiler/testData/codegen/script/outerCapture.kts +++ b/compiler/testData/codegen/script/outerCapture.kts @@ -11,4 +11,4 @@ fun main(): Int { return foo { x -> bar(x) } } -main() \ No newline at end of file +val rv = main() \ No newline at end of file diff --git a/compiler/testData/codegen/script/parameter.kts b/compiler/testData/codegen/script/parameter.kts index 30f08cf456d..754175b9010 100644 --- a/compiler/testData/codegen/script/parameter.kts +++ b/compiler/testData/codegen/script/parameter.kts @@ -2,4 +2,4 @@ // param: what: kotlin.String: sky // param: color: kotlin.String: blue -"$what color is $color" +val rv = "$what color is $color" diff --git a/compiler/testData/codegen/script/parameterArray.kts b/compiler/testData/codegen/script/parameterArray.kts index a55ec42328b..bc517f8017e 100644 --- a/compiler/testData/codegen/script/parameterArray.kts +++ b/compiler/testData/codegen/script/parameterArray.kts @@ -1,4 +1,4 @@ // param: args: kotlin.Array: three little words // expected: rv: little -args[1] +val rv = args[1] diff --git a/compiler/testData/codegen/script/parameterClosure.kts b/compiler/testData/codegen/script/parameterClosure.kts index 535ef0632fd..2db2884ca3e 100644 --- a/compiler/testData/codegen/script/parameterClosure.kts +++ b/compiler/testData/codegen/script/parameterClosure.kts @@ -2,6 +2,6 @@ fun addX(y: Int) = x + y -addX(3) +val rv = addX(3) // expected: rv: 13 diff --git a/compiler/testData/codegen/script/parameterLong.kts b/compiler/testData/codegen/script/parameterLong.kts index 237ab2b32fa..5af7b0c9ab9 100644 --- a/compiler/testData/codegen/script/parameterLong.kts +++ b/compiler/testData/codegen/script/parameterLong.kts @@ -2,4 +2,4 @@ // param: aa: kotlin.Long: 17 // param: bb: kotlin.Int: 2 -aa + bb +val rv = aa + bb diff --git a/compiler/testData/codegen/script/secondLevelFunction.kts b/compiler/testData/codegen/script/secondLevelFunction.kts index 1fdee14fb8a..03bf7f821a1 100644 --- a/compiler/testData/codegen/script/secondLevelFunction.kts +++ b/compiler/testData/codegen/script/secondLevelFunction.kts @@ -1,10 +1,10 @@ -val x: Int +var x: Int = 0 if (true) { fun foo(y: Int) = y + 20 x = foo(9) } -x +val rv = x // expected: rv: 29 diff --git a/compiler/testData/codegen/script/secondLevelFunctionClosure.kts b/compiler/testData/codegen/script/secondLevelFunctionClosure.kts index 0e37d2eef5a..a6257b8219e 100644 --- a/compiler/testData/codegen/script/secondLevelFunctionClosure.kts +++ b/compiler/testData/codegen/script/secondLevelFunctionClosure.kts @@ -1,11 +1,11 @@ val z = 30 -val x: Int +var x: Int = 0 if (true) { fun foo() = z + 20 x = foo() } -x +val rv = x // expected: rv: 50 diff --git a/compiler/testData/codegen/script/secondLevelVal.kts b/compiler/testData/codegen/script/secondLevelVal.kts index 170ab0d7b6a..b334c7f5d52 100644 --- a/compiler/testData/codegen/script/secondLevelVal.kts +++ b/compiler/testData/codegen/script/secondLevelVal.kts @@ -2,7 +2,4 @@ if (true) { val archenemy = "Jim Moriarty" } -true - -// expected: rv: true // expected: archenemy: diff --git a/compiler/testData/codegen/script/simpleClass.kts b/compiler/testData/codegen/script/simpleClass.kts index b2279d0b45e..bfe980473bb 100644 --- a/compiler/testData/codegen/script/simpleClass.kts +++ b/compiler/testData/codegen/script/simpleClass.kts @@ -2,6 +2,6 @@ class SimpleClass(val s: String) { fun foo() = s } -SimpleClass("OK").foo() +val rv = SimpleClass("OK").foo() // expected: rv: OK diff --git a/compiler/testData/codegen/script/string.kts b/compiler/testData/codegen/script/string.kts index 24a71ebd814..6aa62dcfd93 100644 --- a/compiler/testData/codegen/script/string.kts +++ b/compiler/testData/codegen/script/string.kts @@ -1,3 +1,3 @@ -"O" + "K" +val rv = "O" + "K" // expected: rv: OK diff --git a/compiler/testData/codegen/script/topLevelFunction.kts b/compiler/testData/codegen/script/topLevelFunction.kts index f36b8e8e906..1592b7f22b5 100644 --- a/compiler/testData/codegen/script/topLevelFunction.kts +++ b/compiler/testData/codegen/script/topLevelFunction.kts @@ -8,4 +8,4 @@ fun factorial(n: Int): Int { return product } -factorial(10) +val rv = factorial(10) diff --git a/compiler/testData/codegen/script/topLevelFunctionClosure.kts b/compiler/testData/codegen/script/topLevelFunctionClosure.kts index a3eebbda24d..c1cf39206ef 100644 --- a/compiler/testData/codegen/script/topLevelFunctionClosure.kts +++ b/compiler/testData/codegen/script/topLevelFunctionClosure.kts @@ -2,6 +2,6 @@ val x = 12 fun foo(y: Int) = x + y -foo(33) +val rv = foo(33) // expected: rv: 45 diff --git a/compiler/testData/codegen/scriptCustom/fibwprunner.kts b/compiler/testData/codegen/scriptCustom/fibwprunner.kts index 58edd67826a..575bc2e42e8 100644 --- a/compiler/testData/codegen/scriptCustom/fibwprunner.kts +++ b/compiler/testData/codegen/scriptCustom/fibwprunner.kts @@ -1,4 +1,3 @@ val fibwp = test.Fibwp(5) val callResult = fibwp.fib(4) -val result = fibwp.num + fibwp.result - 5 -fibwp.rv \ No newline at end of file +val result = fibwp.num + fibwp.result - 5 \ No newline at end of file diff --git a/compiler/testData/repl/analyzeErrors.repl b/compiler/testData/repl/analyzeErrors.repl index e577a10bbe7..ea310281ca9 100644 --- a/compiler/testData/repl/analyzeErrors.repl +++ b/compiler/testData/repl/analyzeErrors.repl @@ -1,6 +1,6 @@ >>> fun foo() = 765 >>> foo(1) -error: too many arguments for public final fun foo(): kotlin.Int defined in