Files
Yan Zhulanow e978c6f8e0 [kotlin] Move tests in kotlin.features-trainer module to a separate module
This commit partially solves a problem of a circular module dependency between tests of 'kotlin.compiler-plugins.kotlinx-serialization.common' module, tests of 'kotlin.idea.tests' module, and tests of 'kotlin.features-trainer'.

GitOrigin-RevId: e969138bf215202dbe077950d12d64510c6fd5e1
2022-01-22 11:11:15 +00:00

71 lines
1.9 KiB
Kotlin

object Main {
private const val field = 322
@JvmStatic
fun main(args: Array<String>) {
val staticClass = StaticClass()
val abc = 3
val bcd = 5 + field
function(true);
if (abc < bcd && function(true)) {
println(abc * bcd - field)
}
StaticClass.main(null as Array<String>)
}
private fun function(arg: Boolean): Boolean {
return arg
}
private class StaticClass {
fun cyclesFunction(ere: Int): Int {
var i = 10
for (j in 0 until i) {
val res = j - j + j
println(res - j)
}
i += 10
while (i > 0) {
println(i * i)
i--
}
if (true) { i++ }
return i
}
fun stringFunction(sss: String?): String {
val builder = StringBuilder()
builder.append("433" + "322" + 'e' + "wrwer")
val str = builder.toString() + '2' + "123"
return builder.toString() + "322" + "erer" +
"true" + "or false" + str
}
companion object {
@JvmStatic
fun main(args: Array<String>) {
function(false)
}
private fun function(arg: Boolean): Boolean {
return arg && function(function && function || arg)
}
private const val function = true
}
fun selfReturningFunction(arg: Int): StaticClass {
return this
}
var nonStaticField = "123123123"
init {
val instance = StaticClass()
val ss = instance.selfReturningFunction(322).selfReturningFunction(instance.cyclesFunction(0))
.selfReturningFunction(1).nonStaticField
}
}
}
const val globalVariable: Int = 322