KT-987 Unboxing nulls

#KT-987 Fixed
This commit is contained in:
Andrey Breslav
2012-03-26 11:42:34 +04:00
parent 6ce6855a91
commit dd9c36387c
9 changed files with 57 additions and 15 deletions
+2 -2
View File
@@ -84,7 +84,7 @@ inline fun FloatArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this,
inline fun DoubleArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength).sure()
inline fun CharArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength).sure()
inline fun <T> Array<T>.copyOf(newLength: Int = this.size) : Array<T> = Arrays.copyOf(this, newLength).sure()
inline fun <T> Array<T>.copyOf(newLength: Int = this.size) : Array<T> = Arrays.copyOf(this as Array<T?>, newLength) as Array<T>
inline fun BooleanArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to).sure()
inline fun ByteArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to).sure()
@@ -95,7 +95,7 @@ inline fun FloatArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(thi
inline fun DoubleArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to).sure()
inline fun CharArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to).sure()
inline fun <T> Array<T>.copyOfRange(from: Int, to: Int) : Array<T> = Arrays.copyOfRange(this, from, to).sure()
inline fun <T> Array<T>.copyOfRange(from: Int, to: Int) : Array<T> = Arrays.copyOfRange(this as Array<T?>, from, to) as Array<T>
inline val ByteArray.inputStream : ByteArrayInputStream
get() = ByteArrayInputStream(this)
+2 -2
View File
@@ -10,7 +10,7 @@ import java.util.TreeSet
/**
Helper to make jet.Iterator usable in for
*/
inline fun <T> jet.Iterator<T>.iterator() = this
inline fun <T> Iterator<T>.iterator() = this
/**
Helper to make java.util.Iterator usable in for
@@ -24,7 +24,7 @@ fun <erased T> java.util.Enumeration<T>.iterator(): Iterator<T> = object: Iterat
override val hasNext: Boolean
get() = hasMoreElements()
override fun next() = nextElement()
override fun next() = nextElement().sure()
}
/*