From 5da83889d9f9c568433b2dc778d944c1fa0b9bbd Mon Sep 17 00:00:00 2001 From: Svyatoslav Kuzmich Date: Tue, 23 Apr 2019 23:30:07 +0300 Subject: [PATCH] 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. --- libraries/stdlib/test/internalAnnotations.kt | 11 ----------- libraries/stdlib/test/testUtils.kt | 7 ++++--- 2 files changed, 4 insertions(+), 14 deletions(-) delete mode 100644 libraries/stdlib/test/internalAnnotations.kt diff --git a/libraries/stdlib/test/internalAnnotations.kt b/libraries/stdlib/test/internalAnnotations.kt deleted file mode 100644 index e0cd39898ff..00000000000 --- a/libraries/stdlib/test/internalAnnotations.kt +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package kotlin.internal - -// to compile tests in jre/jdk/7/8 projects where stdlib internals are unavailable -@Target(AnnotationTarget.TYPE) -@Retention(AnnotationRetention.BINARY) -internal annotation class NoInfer diff --git a/libraries/stdlib/test/testUtils.kt b/libraries/stdlib/test/testUtils.kt index 109f5c29094..c851c7e1125 100644 --- a/libraries/stdlib/test/testUtils.kt +++ b/libraries/stdlib/test/testUtils.kt @@ -5,13 +5,14 @@ package test -import kotlin.internal.NoInfer import kotlin.test.fail // just a static type check -fun assertStaticTypeIs(@Suppress("UNUSED_PARAMETER") value: @NoInfer T) {} +@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +fun assertStaticTypeIs(@Suppress("UNUSED_PARAMETER") value: @kotlin.internal.NoInfer T) {} -inline fun assertStaticAndRuntimeTypeIs(value: @NoInfer T) { +@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +inline fun assertStaticAndRuntimeTypeIs(value: @kotlin.internal.NoInfer T) { @Suppress("USELESS_CAST") if ((value as Any?) !is T) { fail("Expected value $value to have ${T::class} type")