Delete Hashable, pull up its members to Any

Extensions on nullable types remain in Library.kt

 #KT-1741 Obsolete
 #KT-2805 Obsolete
 #KT-1365 Fixed
 #KT-4517 In Progress
This commit is contained in:
Alexander Udalov
2014-02-04 19:54:06 +04:00
parent 9efdd136ba
commit ec30d52978
46 changed files with 210 additions and 416 deletions
@@ -1,7 +1,7 @@
public class MPair<out A> (
public val first: A
) {
fun equals(o: Any?): Boolean {
override fun equals(o: Any?): Boolean {
val t = o as MPair<*>
return first == t.first
}
@@ -4,7 +4,7 @@ class T4(
val c3: Boolean,
val c4: String
) {
fun equals(o: Any?): Boolean {
override fun equals(o: Any?): Boolean {
if (o !is T4) return false;
return c1 == o.c1 &&
c2 == o.c2 &&
@@ -1,5 +1,5 @@
class C(val x: Int) {
fun equals(rhs: Any?): Boolean {
override fun equals(rhs: Any?): Boolean {
if (rhs is C) {
val rhsC = rhs as C
return rhsC.x == x
@@ -1,6 +0,0 @@
fun foo(): Hashable = 1
fun box(): String {
if (foo() == 1) return "OK"
return "Fail"
}
@@ -1,5 +1,5 @@
data class A(val x: Int) {
fun equals(other: Any?): Boolean = false
override fun equals(other: Any?): Boolean = false
}
fun box(): String {
@@ -16,7 +16,7 @@ data class D(val x: Int) {
data class E(val x: Int) {
fun equals(x: E): Boolean = false
fun equals(x: Any?): Boolean = false
override fun equals(x: Any?): Boolean = false
}
fun box(): String {
@@ -1,5 +1,5 @@
class Dummy {
fun equals(other: Any?) = true
override fun equals(other: Any?) = true
}
open data class A(val v: Any)
@@ -1,5 +1,5 @@
class Dummy {
fun equals(other: Any?) = true
override fun equals(other: Any?) = true
}
data class A(val v: Any?)
@@ -1,5 +1,5 @@
data class A(val x: Int) {
fun hashCode(): Int = -3
override fun hashCode(): Int = -3
}
fun box(): String {
@@ -1,11 +0,0 @@
fun box(): String {
val a = true
val x = if (a) {
listOf(1)
}
else {
1
}
// The result of the if() above is implicitly cast to jet.Hashable, which failed before we started to map Hashable to j.l.Object
return "OK"
}