Add overrides by name. (#54)

This commit is contained in:
Nikolay Igotti
2016-11-14 13:25:50 +03:00
committed by GitHub
parent 248d9ad2ef
commit ae5e838305
3 changed files with 77 additions and 6 deletions
+2 -3
View File
@@ -188,11 +188,10 @@ task hello2(type: RunKonanTest) {
source = "runtime/basic/hello2.kt"
}
/* TODO: enable, once can call toString() on Int.
task hello3(type: RunKonanTest) {
goldValue = "239"
goldValue = "239\ntrue\n3.14159\nA\n"
source = "runtime/basic/hello3.kt"
} */
}
task tostring0(type: RunKonanTest) {
goldValue = "127\n255\n239\nA\n1122334455\n112233445566778899\n1E+27\n1E-300\ntrue\nfalse\n"
+5 -1
View File
@@ -1,3 +1,7 @@
fun main(args : Array<String>) {
print(239)
println(239)
// TODO: enable, once override by name is implemented.
println(true)
println(3.14159)
println('A')
}
+70 -2
View File
@@ -3,14 +3,82 @@ package kotlin.io
@kotlin.SymbolName("Kotlin_io_Console_print")
external public fun print(message: String)
/*
public fun print(message: Int) {
/* TODO: use something like that.
public fun<T> print(message: T) {
print(message.toString())
} */
public fun print(message: Byte) {
print(message.toString())
}
public fun print(message: Short) {
print(message.toString())
}
public fun print(message: Char) {
print(message.toString())
}
public fun print(message: Int) {
print(message.toString())
}
public fun print(message: Long) {
print(message.toString())
}
public fun print(message: Float) {
print(message.toString())
}
public fun print(message: Double) {
print(message.toString())
}
public fun print(message: Boolean) {
print(message.toString())
}
@kotlin.SymbolName("Kotlin_io_Console_println")
external public fun println(message: String)
// TODO: enable, once override by name is implemented.
public fun println(message: Byte) {
println(message.toString())
}
public fun println(message: Short) {
println(message.toString())
}
public fun println(message: Char) {
println(message.toString())
}
public fun println(message: Int) {
println(message.toString())
}
public fun println(message: Long) {
println(message.toString())
}
public fun println(message: Float) {
println(message.toString())
}
public fun println(message: Double) {
println(message.toString())
}
public fun println(message: Boolean) {
println(message.toString())
}
/* TODO: use something like that.
public fun<T> println(message: T) {
print(message.toString())
} */
@kotlin.SymbolName("Kotlin_io_Console_println0")
external public fun println()