Fix array init and add listOf(). (#109)
This commit is contained in:
+1
@@ -36,6 +36,7 @@ class KonanBuiltIns: KotlinBuiltIns {
|
||||
object KonanPlatform : TargetPlatform("Konan") {
|
||||
override val defaultImports: List<ImportPath> = Default.defaultImports + listOf(
|
||||
ImportPath("kotlin.*"),
|
||||
ImportPath("kotlin.collections.*"),
|
||||
ImportPath("kotlin.io.*"),
|
||||
ImportPath("konan.*")
|
||||
)
|
||||
|
||||
@@ -478,7 +478,7 @@ task array_list1(type: RunKonanTest) {
|
||||
}
|
||||
|
||||
task listof0(type: RunKonanTest) {
|
||||
goldValue = "abc\n"
|
||||
goldValue = "abc\n[a, b, c, d]\n[n, s, a]\n"
|
||||
source = "runtime/collections/listof0.kt"
|
||||
}
|
||||
|
||||
|
||||
@@ -2,4 +2,9 @@ fun main(args : Array<String>) {
|
||||
val list = arrayListOf("a", "b", "c")
|
||||
for (element in list) print(element)
|
||||
println()
|
||||
list.add("d")
|
||||
println(list.toString())
|
||||
|
||||
val list2 = listOf("n", "s", "a")
|
||||
println(list2.toString())
|
||||
}
|
||||
Reference in New Issue
Block a user