Add primitive types to String conversion. (#50)

This commit is contained in:
Nikolay Igotti
2016-11-11 14:16:15 +03:00
committed by GitHub
parent a910627357
commit af85121b2c
7 changed files with 125 additions and 4 deletions
+6
View File
@@ -186,6 +186,12 @@ task hello3(type: RunKonanTest) {
source = "runtime/basic/hello3.kt"
} */
task tostring0(type: RunKonanTest) {
goldValue = "127\n255\n239\nA\n1122334455\n112233445566778899\n1E+27\n1E-300\ntrue\nfalse\n"
source = "runtime/basic/tostring0.kt"
}
task if_else(type: UnitKonanTest) {
source = "codegen/branching/if_else.kt"
}
@@ -0,0 +1,14 @@
fun main(args : Array<String>) {
println(127.toByte().toString())
println(255.toByte().toString())
println(239.toShort().toString())
println('A'.toString())
// println('Ё'.toString())
// println('ト'.toString())
println(1122334455.toString())
println(112233445566778899.toString())
println(1e27.toFloat().toString())
println(1e-300.toDouble().toString())
println(true.toString())
println(false.toString())
}