PSI2IR KT-46069 resolve IR-based type parameter descriptors to symbols

This commit is contained in:
Dmitry Petrov
2021-04-14 14:23:32 +03:00
committed by TeamCityServer
parent ba80086ae3
commit f1eeb72c01
6 changed files with 220 additions and 0 deletions
@@ -0,0 +1,14 @@
// SKIP_KT_DUMP
class ObjectAssert<ACTUAL> {
fun describedAs(description: String?, vararg args: Any?): ObjectAssert<ACTUAL>? = null
}
object Assertions {
fun <S> assertThat(actual: S): ObjectAssert<S> = ObjectAssert()
}
fun <T : Any> T?.assertNotNull(description: String? = null) {
val assert = Assertions.assertThat(this)
description?.let(assert::describedAs)
}