Tests for obsolete KT-4798, KT-7288, KT-7046

#KT-4798 Obsolete
 #KT-7288 Obsolete
 #KT-7046 Obsolete
This commit is contained in:
Michael Bogdanov
2015-06-04 15:23:26 +03:00
parent 9e27e208ef
commit dee26957d1
6 changed files with 79 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
fun test(b: Boolean): String {
val a = if (b) IntArray(5) else LongArray(5)
if (a is IntArray) {
val x = a.iterator()
var i = 0
while (x.hasNext()) {
if (a[i] != x.next()) return "Fail $i"
i++
}
return "OK"
} else if (a is LongArray) {
val x = a.iterator()
var i = 0
while (x.hasNext()) {
if (a[i] != x.next()) return "Fail $i"
i++
}
return "OK"
}
return "fail"
}
fun box(): String {
if (test(true) != "OK") return "fail 1: ${test(true)}"
if (test(false) != "OK") return "fail 1: ${test(false)}"
return "OK"
}
+8
View File
@@ -0,0 +1,8 @@
fun box(): String {
val o = "OK" charAt 0
val array = CharArray(2)
array[1] = 'K'
val k = array get 1
return "$o$k"
}