From b9c549803d5f5f791b473978ca65216c15be2e57 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 14 Jul 2021 15:58:48 +0300 Subject: [PATCH] [Test] Replace `public fun box()` with `fun box()` in all box tests --- compiler/testData/codegen/box/arrays/kt33.kt | 2 +- .../testData/codegen/box/classes/kt1134.kt | 2 +- .../testData/codegen/box/classes/kt2482.kt | 2 +- .../testData/codegen/box/classes/kt249.kt | 2 +- .../testData/codegen/box/classes/kt723.kt | 2 +- .../testData/codegen/box/classes/kt725.kt | 2 +- .../testData/codegen/box/classes/kt903.kt | 2 +- .../testData/codegen/box/evaluate/kt9443.kt | 2 +- .../testData/codegen/box/functions/kt395.kt | 2 +- .../box/increment/assignPlusOnSmartCast.kt | 2 +- .../postfixIncrementDoubleSmartCast.kt | 2 +- .../box/increment/postfixIncrementOnClass.kt | 2 +- .../postfixIncrementOnClassSmartCast.kt | 2 +- .../postfixIncrementOnShortSmartCast.kt | 2 +- .../increment/postfixIncrementOnSmartCast.kt | 2 +- .../postfixNullableClassIncrement.kt | 2 +- .../box/increment/postfixNullableIncrement.kt | 2 +- .../box/increment/prefixIncrementOnClass.kt | 2 +- .../prefixIncrementOnClassSmartCast.kt | 2 +- .../increment/prefixIncrementOnSmartCast.kt | 2 +- .../increment/prefixNullableClassIncrement.kt | 2 +- .../box/increment/prefixNullableIncrement.kt | 2 +- .../testData/codegen/box/objects/kt1136.kt | 2 +- .../codegen/box/primitiveTypes/kt2794.kt | 2 +- .../codegen/box/primitiveTypes/kt518.kt | 2 +- .../testData/codegen/box/properties/kt1714.kt | 2 +- .../codegen/box/properties/kt1714_minimal.kt | 2 +- .../codegen/box/regressions/kt5445.kt | 2 +- .../codegen/box/regressions/kt5445_2.kt | 2 +- .../testData/codegen/box/regressions/kt864.kt | 20 +++++++++---------- .../boxInline/anonymousObject/kt9591.kt | 2 +- 31 files changed, 40 insertions(+), 40 deletions(-) diff --git a/compiler/testData/codegen/box/arrays/kt33.kt b/compiler/testData/codegen/box/arrays/kt33.kt index 11253c2739e..c3dec3c39e2 100644 --- a/compiler/testData/codegen/box/arrays/kt33.kt +++ b/compiler/testData/codegen/box/arrays/kt33.kt @@ -2,7 +2,7 @@ // WASM_MUTE_REASON: STDLIB_COLLECTIONS // KJS_WITH_FULL_RUNTIME -fun box () : String { +fun box() : String { val s = ArrayList() s.add("foo") s[0] += "bar" diff --git a/compiler/testData/codegen/box/classes/kt1134.kt b/compiler/testData/codegen/box/classes/kt1134.kt index 9022b6c5a8e..8ab953a6b75 100644 --- a/compiler/testData/codegen/box/classes/kt1134.kt +++ b/compiler/testData/codegen/box/classes/kt1134.kt @@ -3,7 +3,7 @@ public class SomeClass() : java.lang.Object() { } -public fun box():String { +fun box():String { System.out?.println(SomeClass().getClass()) return "OK" } diff --git a/compiler/testData/codegen/box/classes/kt2482.kt b/compiler/testData/codegen/box/classes/kt2482.kt index 6a614198741..c8219235f1c 100644 --- a/compiler/testData/codegen/box/classes/kt2482.kt +++ b/compiler/testData/codegen/box/classes/kt2482.kt @@ -1,4 +1,4 @@ -public fun box() : String { +fun box() : String { if ( 0 == 0 ) { // Does not crash if either this... if ( 0 == 0 ) { // ...or this is changed to if ( true ) // Does not crash if the following is uncommented. diff --git a/compiler/testData/codegen/box/classes/kt249.kt b/compiler/testData/codegen/box/classes/kt249.kt index afd8fa0a0a7..9278e0777e5 100644 --- a/compiler/testData/codegen/box/classes/kt249.kt +++ b/compiler/testData/codegen/box/classes/kt249.kt @@ -7,7 +7,7 @@ class Outer() { } } -fun box (): String { +fun box(): String { val inner = Outer.Companion.Inner() return "OK" } diff --git a/compiler/testData/codegen/box/classes/kt723.kt b/compiler/testData/codegen/box/classes/kt723.kt index 6d020a0bc99..0e2a595eadf 100644 --- a/compiler/testData/codegen/box/classes/kt723.kt +++ b/compiler/testData/codegen/box/classes/kt723.kt @@ -1,6 +1,6 @@ operator fun Int?.inc() : Int { if (this != null) return this.inc() else throw NullPointerException() } -public fun box() : String { +fun box() : String { var i : Int? = 10 val j = i++ diff --git a/compiler/testData/codegen/box/classes/kt725.kt b/compiler/testData/codegen/box/classes/kt725.kt index 3aea020f890..ec4ec35d782 100644 --- a/compiler/testData/codegen/box/classes/kt725.kt +++ b/compiler/testData/codegen/box/classes/kt725.kt @@ -1,6 +1,6 @@ operator fun Int?.inc() = this!!.inc() -public fun box() : String { +fun box() : String { var i : Int? = 10 val j = i++ diff --git a/compiler/testData/codegen/box/classes/kt903.kt b/compiler/testData/codegen/box/classes/kt903.kt index b4a75ee8128..34c3e53c36e 100644 --- a/compiler/testData/codegen/box/classes/kt903.kt +++ b/compiler/testData/codegen/box/classes/kt903.kt @@ -22,4 +22,4 @@ public open class PerfectNumberFinder() { } } -fun box () = if (PerfectNumberFinder().isPerfect(28)) "OK" else "fail" +fun box() = if (PerfectNumberFinder().isPerfect(28)) "OK" else "fail" diff --git a/compiler/testData/codegen/box/evaluate/kt9443.kt b/compiler/testData/codegen/box/evaluate/kt9443.kt index 7428e8b04df..5eddfe565fb 100644 --- a/compiler/testData/codegen/box/evaluate/kt9443.kt +++ b/compiler/testData/codegen/box/evaluate/kt9443.kt @@ -12,7 +12,7 @@ class ImplClass: BaseClass() { override val menuId: Int = 3 } -public fun box(): String { +fun box(): String { val result = ImplClass().run() if (result != ("3" to false)) return "Fail: $result" diff --git a/compiler/testData/codegen/box/functions/kt395.kt b/compiler/testData/codegen/box/functions/kt395.kt index 310640226e0..a563a7eee6d 100644 --- a/compiler/testData/codegen/box/functions/kt395.kt +++ b/compiler/testData/codegen/box/functions/kt395.kt @@ -2,7 +2,7 @@ fun Any.with(operation : Any.() -> Any) = operation().toString() val f = { a : Int -> } -fun box () : String { +fun box() : String { return if(20.with { this } == "20") diff --git a/compiler/testData/codegen/box/increment/assignPlusOnSmartCast.kt b/compiler/testData/codegen/box/increment/assignPlusOnSmartCast.kt index f3b84e034bd..a9428d231e9 100644 --- a/compiler/testData/codegen/box/increment/assignPlusOnSmartCast.kt +++ b/compiler/testData/codegen/box/increment/assignPlusOnSmartCast.kt @@ -1,4 +1,4 @@ -public fun box() : String { +fun box() : String { var i : Int? i = 10 // assignPlus on a smart cast should work diff --git a/compiler/testData/codegen/box/increment/postfixIncrementDoubleSmartCast.kt b/compiler/testData/codegen/box/increment/postfixIncrementDoubleSmartCast.kt index 738a31c9697..2679d496638 100644 --- a/compiler/testData/codegen/box/increment/postfixIncrementDoubleSmartCast.kt +++ b/compiler/testData/codegen/box/increment/postfixIncrementDoubleSmartCast.kt @@ -1,4 +1,4 @@ -public fun box() : String { +fun box() : String { var i : Int? i = 10 // We have "double" smart cast here: diff --git a/compiler/testData/codegen/box/increment/postfixIncrementOnClass.kt b/compiler/testData/codegen/box/increment/postfixIncrementOnClass.kt index deb8df65d80..834baa050b1 100644 --- a/compiler/testData/codegen/box/increment/postfixIncrementOnClass.kt +++ b/compiler/testData/codegen/box/increment/postfixIncrementOnClass.kt @@ -3,7 +3,7 @@ class Derived: Base class Another: Base operator fun Base.inc(): Derived { return Derived() } -public fun box() : String { +fun box() : String { var i : Base i = Another() val j = i++ diff --git a/compiler/testData/codegen/box/increment/postfixIncrementOnClassSmartCast.kt b/compiler/testData/codegen/box/increment/postfixIncrementOnClassSmartCast.kt index 3bc2442a3be..ffc56dd2b88 100644 --- a/compiler/testData/codegen/box/increment/postfixIncrementOnClassSmartCast.kt +++ b/compiler/testData/codegen/box/increment/postfixIncrementOnClassSmartCast.kt @@ -2,7 +2,7 @@ open class Base class Derived: Base() operator fun Derived.inc(): Derived { return Derived() } -public fun box() : String { +fun box() : String { var i : Base i = Derived() val j = i++ diff --git a/compiler/testData/codegen/box/increment/postfixIncrementOnShortSmartCast.kt b/compiler/testData/codegen/box/increment/postfixIncrementOnShortSmartCast.kt index 0dec61d0503..4da28f26dee 100644 --- a/compiler/testData/codegen/box/increment/postfixIncrementOnShortSmartCast.kt +++ b/compiler/testData/codegen/box/increment/postfixIncrementOnShortSmartCast.kt @@ -1,4 +1,4 @@ -public fun box() : String { +fun box() : String { var i : Short? i = 10 // Postfix increment on a smart casted short should work diff --git a/compiler/testData/codegen/box/increment/postfixIncrementOnSmartCast.kt b/compiler/testData/codegen/box/increment/postfixIncrementOnSmartCast.kt index 3da28a2d6e6..c6e47ab0e6d 100644 --- a/compiler/testData/codegen/box/increment/postfixIncrementOnSmartCast.kt +++ b/compiler/testData/codegen/box/increment/postfixIncrementOnSmartCast.kt @@ -1,4 +1,4 @@ -public fun box() : String { +fun box() : String { var i : Int? i = 10 // Postfix increment on a smart cast should work diff --git a/compiler/testData/codegen/box/increment/postfixNullableClassIncrement.kt b/compiler/testData/codegen/box/increment/postfixNullableClassIncrement.kt index b6d22b07a1b..0a6875c9cb3 100644 --- a/compiler/testData/codegen/box/increment/postfixNullableClassIncrement.kt +++ b/compiler/testData/codegen/box/increment/postfixNullableClassIncrement.kt @@ -2,7 +2,7 @@ class MyClass operator fun MyClass?.inc(): MyClass? = null -public fun box() : String { +fun box() : String { var i : MyClass? i = MyClass() val j = i++ diff --git a/compiler/testData/codegen/box/increment/postfixNullableIncrement.kt b/compiler/testData/codegen/box/increment/postfixNullableIncrement.kt index 2564e3ed898..2f7a94c532e 100644 --- a/compiler/testData/codegen/box/increment/postfixNullableIncrement.kt +++ b/compiler/testData/codegen/box/increment/postfixNullableIncrement.kt @@ -2,7 +2,7 @@ operator fun Int?.inc(): Int? = this fun init(): Int? { return 10 } -public fun box() : String { +fun box() : String { var i : Int? = init() val j = i++ diff --git a/compiler/testData/codegen/box/increment/prefixIncrementOnClass.kt b/compiler/testData/codegen/box/increment/prefixIncrementOnClass.kt index 6bc75ad060e..231bcc9a653 100644 --- a/compiler/testData/codegen/box/increment/prefixIncrementOnClass.kt +++ b/compiler/testData/codegen/box/increment/prefixIncrementOnClass.kt @@ -3,7 +3,7 @@ class Derived: Base class Another: Base operator fun Base.inc(): Derived { return Derived() } -public fun box() : String { +fun box() : String { var i : Base i = Another() val j = ++i diff --git a/compiler/testData/codegen/box/increment/prefixIncrementOnClassSmartCast.kt b/compiler/testData/codegen/box/increment/prefixIncrementOnClassSmartCast.kt index c51f6d1d816..b898c9da668 100644 --- a/compiler/testData/codegen/box/increment/prefixIncrementOnClassSmartCast.kt +++ b/compiler/testData/codegen/box/increment/prefixIncrementOnClassSmartCast.kt @@ -2,7 +2,7 @@ open class Base class Derived: Base() operator fun Derived.inc(): Derived { return Derived() } -public fun box() : String { +fun box() : String { var i : Base i = Derived() val j = ++i diff --git a/compiler/testData/codegen/box/increment/prefixIncrementOnSmartCast.kt b/compiler/testData/codegen/box/increment/prefixIncrementOnSmartCast.kt index 80e48f4f78b..d4e5f7d523c 100644 --- a/compiler/testData/codegen/box/increment/prefixIncrementOnSmartCast.kt +++ b/compiler/testData/codegen/box/increment/prefixIncrementOnSmartCast.kt @@ -1,4 +1,4 @@ -public fun box() : String { +fun box() : String { var i : Int? i = 10 // Prefix increment on a smart cast should work diff --git a/compiler/testData/codegen/box/increment/prefixNullableClassIncrement.kt b/compiler/testData/codegen/box/increment/prefixNullableClassIncrement.kt index e8c98d7bce6..5a75c163fa2 100644 --- a/compiler/testData/codegen/box/increment/prefixNullableClassIncrement.kt +++ b/compiler/testData/codegen/box/increment/prefixNullableClassIncrement.kt @@ -2,7 +2,7 @@ class MyClass operator fun MyClass?.inc(): MyClass? = null -public fun box() : String { +fun box() : String { var i : MyClass? i = MyClass() val j = ++i diff --git a/compiler/testData/codegen/box/increment/prefixNullableIncrement.kt b/compiler/testData/codegen/box/increment/prefixNullableIncrement.kt index 2c28b62ff11..778d469cbc7 100644 --- a/compiler/testData/codegen/box/increment/prefixNullableIncrement.kt +++ b/compiler/testData/codegen/box/increment/prefixNullableIncrement.kt @@ -2,7 +2,7 @@ operator fun Int?.inc(): Int? = this fun init(): Int? { return 10 } -public fun box() : String { +fun box() : String { var i : Int? = init() val j = ++i diff --git a/compiler/testData/codegen/box/objects/kt1136.kt b/compiler/testData/codegen/box/objects/kt1136.kt index 9caf5855971..ccd749de125 100644 --- a/compiler/testData/codegen/box/objects/kt1136.kt +++ b/compiler/testData/codegen/box/objects/kt1136.kt @@ -41,7 +41,7 @@ public class SomeClass() { } } -public fun box(): String { +fun box(): String { var obj = SomeClass() return if (obj.status == null) "OK" else { (obj.status as java.lang.Throwable).printStackTrace() diff --git a/compiler/testData/codegen/box/primitiveTypes/kt2794.kt b/compiler/testData/codegen/box/primitiveTypes/kt2794.kt index bd6c80dced5..9c944caf19a 100644 --- a/compiler/testData/codegen/box/primitiveTypes/kt2794.kt +++ b/compiler/testData/codegen/box/primitiveTypes/kt2794.kt @@ -1,4 +1,4 @@ -fun box () : String { +fun box() : String { val b = 4.toByte() val s = 5.toShort() val c: Char = 'A' diff --git a/compiler/testData/codegen/box/primitiveTypes/kt518.kt b/compiler/testData/codegen/box/primitiveTypes/kt518.kt index f1ec08f1c2f..be683a8ab7b 100644 --- a/compiler/testData/codegen/box/primitiveTypes/kt518.kt +++ b/compiler/testData/codegen/box/primitiveTypes/kt518.kt @@ -9,7 +9,7 @@ fun foo(i : Int?, a : Any?) { } } -fun box () : String { +fun box() : String { foo(2, "239") return "OK" } diff --git a/compiler/testData/codegen/box/properties/kt1714.kt b/compiler/testData/codegen/box/properties/kt1714.kt index 9624bc8f496..363dc278634 100644 --- a/compiler/testData/codegen/box/properties/kt1714.kt +++ b/compiler/testData/codegen/box/properties/kt1714.kt @@ -23,7 +23,7 @@ fun test(a : A) { } } -public fun box() : String { +fun box() : String { AImpl().test test(AImpl()) return "OK" diff --git a/compiler/testData/codegen/box/properties/kt1714_minimal.kt b/compiler/testData/codegen/box/properties/kt1714_minimal.kt index faec0d99269..5fa07495a68 100644 --- a/compiler/testData/codegen/box/properties/kt1714_minimal.kt +++ b/compiler/testData/codegen/box/properties/kt1714_minimal.kt @@ -6,7 +6,7 @@ class AImpl : A { override val v: Int = 5 } -public fun box() : String { +fun box() : String { val a: A = AImpl() a.v return "OK" diff --git a/compiler/testData/codegen/box/regressions/kt5445.kt b/compiler/testData/codegen/box/regressions/kt5445.kt index b48b0a64a98..aace185350e 100644 --- a/compiler/testData/codegen/box/regressions/kt5445.kt +++ b/compiler/testData/codegen/box/regressions/kt5445.kt @@ -10,7 +10,7 @@ package test2 import test.A -public fun box(): String { +fun box(): String { return B().test(B()) } diff --git a/compiler/testData/codegen/box/regressions/kt5445_2.kt b/compiler/testData/codegen/box/regressions/kt5445_2.kt index eaaedcb0c22..e58073fc814 100644 --- a/compiler/testData/codegen/box/regressions/kt5445_2.kt +++ b/compiler/testData/codegen/box/regressions/kt5445_2.kt @@ -16,7 +16,7 @@ class C : A() { } } -public fun box(): String { +fun box(): String { return C().a() } diff --git a/compiler/testData/codegen/box/regressions/kt864.kt b/compiler/testData/codegen/box/regressions/kt864.kt index 91d9a1fbbc4..38ff0a40dbb 100644 --- a/compiler/testData/codegen/box/regressions/kt864.kt +++ b/compiler/testData/codegen/box/regressions/kt864.kt @@ -11,15 +11,15 @@ fun sample() : Reader { World"""); } - fun box() : String { - // NOTE: Also tested in stdlib: LineIteratorTest.useLines +fun box() : String { + // NOTE: Also tested in stdlib: LineIteratorTest.useLines - // TODO compiler error - // both these expressions causes java.lang.NoClassDefFoundError: collections/CollectionPackage - val list1 = sample().useLines { it.toList() } - val list2 = sample().useLines>{ it.toCollection(arrayListOf()) } + // TODO compiler error + // both these expressions causes java.lang.NoClassDefFoundError: collections/CollectionPackage + val list1 = sample().useLines { it.toList() } + val list2 = sample().useLines>{ it.toCollection(arrayListOf()) } - if(arrayListOf("Hello", "World") != list1) return "fail" - if(arrayListOf("Hello", "World") != list2) return "fail" - return "OK" - } + if(arrayListOf("Hello", "World") != list1) return "fail" + if(arrayListOf("Hello", "World") != list2) return "fail" + return "OK" +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/kt9591.kt b/compiler/testData/codegen/boxInline/anonymousObject/kt9591.kt index 858e2bd78d1..a3a7f8d1d96 100644 --- a/compiler/testData/codegen/boxInline/anonymousObject/kt9591.kt +++ b/compiler/testData/codegen/boxInline/anonymousObject/kt9591.kt @@ -13,7 +13,7 @@ inline fun inlineFun(p: () -> Unit) { import test.* -public fun box(): String { +fun box(): String { var z = "fail" inlineFun { val obj = object {