Stdlib tests: Supporess NoInfer access instead of redeclaration
Stdlib annotation 'kotlin.internal.NoInfer' was redeclared in stdlib tests so non-fried modules (kotlin-stdlib-jdk7, kotlin-stdlib-jdk8, etc.) could access it. IR deserializer does not support declaration duplicates (at least yet for JS IR backend). Thus this commit removes this redeclaration and suppresses errors on its usages instead.
This commit is contained in:
@@ -5,13 +5,14 @@
|
||||
|
||||
package test
|
||||
|
||||
import kotlin.internal.NoInfer
|
||||
import kotlin.test.fail
|
||||
|
||||
// just a static type check
|
||||
fun <T> assertStaticTypeIs(@Suppress("UNUSED_PARAMETER") value: @NoInfer T) {}
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <T> assertStaticTypeIs(@Suppress("UNUSED_PARAMETER") value: @kotlin.internal.NoInfer T) {}
|
||||
|
||||
inline fun <reified T> assertStaticAndRuntimeTypeIs(value: @NoInfer T) {
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
inline fun <reified T> assertStaticAndRuntimeTypeIs(value: @kotlin.internal.NoInfer T) {
|
||||
@Suppress("USELESS_CAST")
|
||||
if ((value as Any?) !is T) {
|
||||
fail("Expected value $value to have ${T::class} type")
|
||||
|
||||
Reference in New Issue
Block a user