Replace test assertions in the prod code with require

This commit is contained in:
Sergey Mashkov
2015-11-24 17:57:54 +03:00
parent e25d31618c
commit f1783530ac
5 changed files with 8 additions and 11 deletions
@@ -37,7 +37,7 @@ import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
import org.jetbrains.kotlin.resolve.calls.model.ArgumentMatch
import org.jetbrains.kotlin.types.expressions.OperatorConventions
import java.util.*
import kotlin.test.assertTrue
import kotlin.text.Regex
// NOTE: in this file we collect only Kotlin-specific methods working with PSI and not modifying it
@@ -226,7 +226,7 @@ public fun StubBasedPsiElementBase<out KotlinClassOrObjectStub<out KtClassOrObje
}
}
assertTrue(this is KtClassOrObject)
require(this is KtClassOrObject) { "it should be ${KtClassOrObject::class} but it is a ${this.javaClass.name}" }
val stub = getStub()
if (stub != null) {
@@ -438,4 +438,5 @@ fun checkReservedPrefixWord(sink: DiagnosticSink, element: PsiElement, word: Str
KtPsiUtil.getPreviousWord(element, word)?.let {
sink.report(Errors.UNSUPPORTED.on(it, message))
}
}
}