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
+5 -1
View File
@@ -1,3 +1,7 @@
package jet
public open class Any() {}
public open class Any {
public open fun equals(other: Any?): Boolean
public open fun hashCode(): Int
}
+1 -4
View File
@@ -1,6 +1,6 @@
package jet
public class Char private () : Hashable, Comparable<Char> {
public class Char private () : Comparable<Char> {
public fun compareTo(other : Double) : Int
public fun compareTo(other : Float) : Int
public fun compareTo(other : Long) : Int
@@ -63,7 +63,4 @@ public class Char private () : Hashable, Comparable<Char> {
public fun toChar() : Char
public fun toShort() : Short
public fun toByte() : Byte
public override fun hashCode() : Int
public override fun equals(other : Any?) : Boolean
}
+4 -4
View File
@@ -8,7 +8,7 @@ public trait MutableIterable<out T> : Iterable<T> {
override fun iterator() : MutableIterator<T>
}
public trait Collection<out E> : Iterable<E>, Hashable {
public trait Collection<out E> : Iterable<E> {
// Query Operations
public fun size() : Int
public fun isEmpty() : Boolean
@@ -123,7 +123,7 @@ public trait Map<K, out V> {
public fun values() : Collection<V>
public fun entrySet() : Set<Map.Entry<K, V>>
public trait Entry<out K, out V> : Hashable {
public trait Entry<out K, out V> {
public fun getKey() : K
public fun getValue() : V
}
@@ -143,7 +143,7 @@ public trait MutableMap<K, V> : Map<K, V> {
override fun values() : MutableCollection<V>
override fun entrySet() : MutableSet<MutableMap.MutableEntry<K, V>>
public trait MutableEntry<K,V> : Map.Entry<K, V>, Hashable {
public trait MutableEntry<K,V> : Map.Entry<K, V> {
public fun setValue(value : V) : V
}
}
}
+5 -15
View File
@@ -4,27 +4,21 @@ public trait Annotation
public annotation class volatile
public fun <R> synchronized(lock: Any, block : () -> R) : R
public fun <R> synchronized(lock: Any, block: () -> R): R
public fun Any?.identityEquals(other : Any?) : Boolean // = this === other
public fun Any?.identityEquals(other: Any?): Boolean // = this === other
// Can't write a body due to a bootstrapping problem (see JET-74)
public fun Any?.equals(other : Any?) : Boolean// = this === other
public fun Any?.equals(other: Any?): Boolean
// Returns "null" for null
public fun Any?.toString() : String// = this === other
public fun Any?.toString(): String
public fun String?.plus(other: Any?) : String
public fun String?.plus(other: Any?): String
public trait Comparable<in T> {
public fun compareTo(other : T) : Int
}
public trait Hashable {
public fun hashCode() : Int
public fun equals(other : Any?) : Boolean
}
public class Boolean private () : Comparable<Boolean> {
public fun not() : Boolean
@@ -35,8 +29,6 @@ public class Boolean private () : Comparable<Boolean> {
public fun xor(other : Boolean) : Boolean
public override fun compareTo(other : Boolean) : Int
public fun equals(other : Any?) : Boolean
}
public trait CharSequence {
@@ -50,8 +42,6 @@ public trait CharSequence {
public class String() : Comparable<String>, CharSequence {
public fun plus(other : Any?) : String
public fun equals(other : Any?) : Boolean
public override fun compareTo(that : String) : Int
public override fun get(index : Int) : Char
public override fun toString() : String
+1 -26
View File
@@ -1,6 +1,6 @@
package jet
public abstract class Number : Hashable {
public abstract class Number {
public abstract fun toDouble() : Double
public abstract fun toFloat() : Float
public abstract fun toLong() : Long
@@ -8,13 +8,6 @@ public abstract class Number : Hashable {
public abstract fun toChar() : Char
public abstract fun toShort() : Short
public abstract fun toByte() : Byte
// fun equals(other : Double) : Boolean
// fun equals(other : Float) : Boolean
// fun equals(other : Long) : Boolean
// fun equals(other : Byte) : Boolean
// fun equals(other : Int) : Boolean
// fun equals(other : Short) : Boolean
// fun equals(other : Char) : Boolean
}
public class Double private () : Number, Comparable<Double> {
@@ -85,9 +78,6 @@ public class Double private () : Number, Comparable<Double> {
public override fun toChar() : Char
public override fun toShort() : Short
public override fun toByte() : Byte
public override fun hashCode() : Int
public override fun equals(other : Any?) : Boolean
}
public class Float private () : Number, Comparable<Float> {
@@ -159,9 +149,6 @@ public class Float private () : Number, Comparable<Float> {
public override fun toChar() : Char
public override fun toShort() : Short
public override fun toByte() : Byte
public override fun hashCode() : Int
public override fun equals(other : Any?) : Boolean
}
public class Long private () : Number, Comparable<Long> {
@@ -241,9 +228,6 @@ public class Long private () : Number, Comparable<Long> {
public override fun toChar() : Char
public override fun toShort() : Short
public override fun toByte() : Byte
public override fun hashCode() : Int
public override fun equals(other : Any?) : Boolean
}
public class Int private () : Number, Comparable<Int> {
@@ -323,9 +307,6 @@ public class Int private () : Number, Comparable<Int> {
public override fun toChar() : Char
public override fun toShort() : Short
public override fun toByte() : Byte
public override fun hashCode() : Int
public override fun equals(other : Any?) : Boolean
}
public class Short private () : Number, Comparable<Short> {
@@ -397,9 +378,6 @@ public class Short private () : Number, Comparable<Short> {
public override fun toChar() : Char
public override fun toShort() : Short
public override fun toByte() : Byte
public override fun hashCode() : Int
public override fun equals(other : Any?) : Boolean
}
public class Byte private () : Number, Comparable<Byte> {
@@ -471,7 +449,4 @@ public class Byte private () : Number, Comparable<Byte> {
public override fun toChar() : Char
public override fun toShort() : Short
public override fun toByte() : Byte
public override fun hashCode() : Int
public override fun equals(other : Any?) : Boolean
}