Replaced sure() invocations with '!!' operator in diagnostic tests.
This commit is contained in:
@@ -3,7 +3,7 @@ package kt1189
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock
|
||||
|
||||
inline fun <T> ReentrantReadWriteLock.write(action: ()->T) : T {
|
||||
val rl = readLock().sure()
|
||||
val rl = readLock()!!
|
||||
var readCount = 0
|
||||
val writeCount = getWriteHoldCount()
|
||||
if(writeCount == 0) {
|
||||
@@ -13,7 +13,7 @@ inline fun <T> ReentrantReadWriteLock.write(action: ()->T) : T {
|
||||
rl.unlock()
|
||||
}
|
||||
|
||||
val wl = writeLock().sure()
|
||||
val wl = writeLock()!!
|
||||
wl.lock()
|
||||
try {
|
||||
return action()
|
||||
|
||||
@@ -14,7 +14,7 @@ fun <T : Any> T?.iterator() = object {
|
||||
fun next() : T {
|
||||
if (hasNext) {
|
||||
hasNext = false
|
||||
return this@iterator.sure()
|
||||
return this@iterator!!
|
||||
}
|
||||
throw java.util.NoSuchElementException()
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ fun getJavaClass<T>() : java.lang.Class<T> { <!NO_RETURN_IN_FUNCTION_WITH_BLOCK_
|
||||
public class Throwables() {
|
||||
class object {
|
||||
public fun propagateIfInstanceOf<X : Throwable?>(throwable : Throwable?, declaredType : Class<X?>?) : Unit {
|
||||
if (((throwable != null) && declaredType?.isInstance(throwable).sure()))
|
||||
if (((throwable != null) && declaredType?.isInstance(throwable)!!))
|
||||
{
|
||||
throw declaredType?.cast(throwable)!!
|
||||
}
|
||||
|
||||
@@ -27,5 +27,5 @@ fun test(a : List<Int>, m : Map<String, Int>) {
|
||||
)
|
||||
HashMap<Int, Int>().get(0)
|
||||
if (m.get("") != null)
|
||||
System.out.println(m.get("").sure().plus(1))
|
||||
System.out.println(m.get("")!!.plus(1))
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ fun getJavaClass<T>() : java.lang.Class<T> { return "" <!CAST_NEVER_SUCCEEDS!>as
|
||||
public class Throwables() {
|
||||
class object {
|
||||
public fun propagateIfInstanceOf<X : Throwable?>(throwable : Throwable?, declaredType : Class<X?>?) {
|
||||
if (((throwable != null) && declaredType?.isInstance(throwable).sure()))
|
||||
if (((throwable != null) && declaredType?.isInstance(throwable)!!))
|
||||
{
|
||||
throw declaredType?.cast(throwable).sure()
|
||||
throw declaredType?.cast(throwable)!!
|
||||
}
|
||||
}
|
||||
public fun propagateIfPossible(throwable : Throwable?) {
|
||||
|
||||
Reference in New Issue
Block a user