TEST: Coercion to Unit and ++/-- tests. (#87)
This commit is contained in:
@@ -398,6 +398,11 @@ task throw0(type: RunKonanTest) {
|
|||||||
source = "runtime/basic/throw0.kt"
|
source = "runtime/basic/throw0.kt"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task statements0(type: RunKonanTest) {
|
||||||
|
goldValue = "239\n238\n30\n29\n"
|
||||||
|
source = "runtime/basic/statements0.kt"
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
task boxing0(type: RunKonanTest) {
|
task boxing0(type: RunKonanTest) {
|
||||||
goldValue = "17\n"
|
goldValue = "17\n"
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
fun simple() {
|
||||||
|
var a = 238
|
||||||
|
a++
|
||||||
|
println(a)
|
||||||
|
--a
|
||||||
|
println(a)
|
||||||
|
}
|
||||||
|
|
||||||
|
class Foo() {
|
||||||
|
var i = 29
|
||||||
|
|
||||||
|
fun more() {
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
|
||||||
|
fun less() {
|
||||||
|
--i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun fields() {
|
||||||
|
val foo = Foo()
|
||||||
|
foo.more()
|
||||||
|
println(foo.i)
|
||||||
|
foo.less()
|
||||||
|
println(foo.i)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
simple()
|
||||||
|
fields()
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user