From 8dfcebf542f740925a7f72c7d7ad23cb48d01027 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Thu, 18 Jun 2020 23:31:39 +0300 Subject: [PATCH] Expose KTypeProjection.STAR constant in a field #KT-30083 --- libraries/stdlib/src/kotlin/reflect/KType.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/stdlib/src/kotlin/reflect/KType.kt b/libraries/stdlib/src/kotlin/reflect/KType.kt index 8356478ecf4..56ce1c202ae 100644 --- a/libraries/stdlib/src/kotlin/reflect/KType.kt +++ b/libraries/stdlib/src/kotlin/reflect/KType.kt @@ -5,6 +5,7 @@ package kotlin.reflect +import kotlin.jvm.JvmField import kotlin.jvm.JvmStatic /** @@ -91,13 +92,18 @@ public data class KTypeProjection constructor( } public companion object { + // provided for compiler access + @JvmField + @PublishedApi + internal val star: KTypeProjection = KTypeProjection(null, null) + /** * Star projection, denoted by the `*` character. * For example, in the type `KClass<*>`, `*` is the star projection. * See the [Kotlin language documentation](https://kotlinlang.org/docs/reference/generics.html#star-projections) * for more information. */ - public val STAR: KTypeProjection = KTypeProjection(null, null) + public val STAR: KTypeProjection get() = star /** * Creates an invariant projection of a given type. Invariant projection is just the type itself,