Sort out JVM intrinsics for equals, hashCode, toString

This commit is contained in:
Alexander Udalov
2014-02-07 15:49:28 +04:00
parent 3dcd85bdb4
commit 774e5f0535
4 changed files with 81 additions and 65 deletions
@@ -0,0 +1,68 @@
fun box(): String {
val b: Byte = 42
val c: Char = 'z'
val s: Short = 239
val i: Int = -1
val j: Long = -42L
val f: Float = 3.14f
val d: Double = -2.72
val z: Boolean = true
b.equals(b)
b equals b
b == b
b.hashCode()
b.toString()
"$b"
c.equals(c)
c equals c
c == c
c.hashCode()
c.toString()
"$c"
s.equals(s)
s equals s
s == s
s.hashCode()
s.toString()
"$s"
i.equals(i)
i equals i
i == i
i.hashCode()
i.toString()
"$i"
j.equals(j)
j equals j
j == j
j.hashCode()
j.toString()
"$j"
f.equals(f)
f equals f
f == f
f.hashCode()
f.toString()
"$f"
d.equals(d)
d equals d
d == d
d.hashCode()
d.toString()
"$d"
z.equals(z)
z equals z
z == z
z.hashCode()
z.toString()
"$z"
return "OK"
}