From 5de734c9f3414c0dee6f79567031e92b5d1e09fb Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Fri, 14 Sep 2012 17:22:34 +0400 Subject: [PATCH] Replaced sure() invocations with '!!' operator in diagnostic tests. --- .../testData/diagnostics/tests/controlFlowAnalysis/kt1189.kt | 4 ++-- .../testData/diagnostics/tests/extensions/GenericIterator.kt | 2 +- .../testData/diagnostics/tests/inference/regressions/kt702.kt | 2 +- .../diagnostics/tests/jdk-annotations/ArrayListAndMap.kt | 2 +- compiler/testData/diagnostics/tests/regressions/kt701.kt | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.kt index 09138e4301c..ac05a5f9e5b 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.kt @@ -3,7 +3,7 @@ package kt1189 import java.util.concurrent.locks.ReentrantReadWriteLock inline fun 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 ReentrantReadWriteLock.write(action: ()->T) : T { rl.unlock() } - val wl = writeLock().sure() + val wl = writeLock()!! wl.lock() try { return action() diff --git a/compiler/testData/diagnostics/tests/extensions/GenericIterator.kt b/compiler/testData/diagnostics/tests/extensions/GenericIterator.kt index cb36d9a5993..bf5d4297e18 100644 --- a/compiler/testData/diagnostics/tests/extensions/GenericIterator.kt +++ b/compiler/testData/diagnostics/tests/extensions/GenericIterator.kt @@ -14,7 +14,7 @@ fun T?.iterator() = object { fun next() : T { if (hasNext) { hasNext = false - return this@iterator.sure() + return this@iterator!! } throw java.util.NoSuchElementException() } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt702.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt702.kt index df7771256b8..88f8fcf843c 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt702.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt702.kt @@ -7,7 +7,7 @@ fun getJavaClass() : java.lang.Class { (throwable : Throwable?, declaredType : Class?) : Unit { - if (((throwable != null) && declaredType?.isInstance(throwable).sure())) + if (((throwable != null) && declaredType?.isInstance(throwable)!!)) { throw declaredType?.cast(throwable)!! } diff --git a/compiler/testData/diagnostics/tests/jdk-annotations/ArrayListAndMap.kt b/compiler/testData/diagnostics/tests/jdk-annotations/ArrayListAndMap.kt index bf44ac7ce79..afd98c48ada 100644 --- a/compiler/testData/diagnostics/tests/jdk-annotations/ArrayListAndMap.kt +++ b/compiler/testData/diagnostics/tests/jdk-annotations/ArrayListAndMap.kt @@ -27,5 +27,5 @@ fun test(a : List, m : Map) { ) HashMap().get(0) if (m.get("") != null) - System.out.println(m.get("").sure().plus(1)) + System.out.println(m.get("")!!.plus(1)) } diff --git a/compiler/testData/diagnostics/tests/regressions/kt701.kt b/compiler/testData/diagnostics/tests/regressions/kt701.kt index fab435ae4bf..beccf81e97a 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt701.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt701.kt @@ -4,9 +4,9 @@ fun getJavaClass() : java.lang.Class { return "" as public class Throwables() { class object { public fun propagateIfInstanceOf(throwable : Throwable?, declaredType : Class?) { - 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?) {