[JS] Support wrapped and dynamic types in typeOf
This commit is contained in:
@@ -19,6 +19,9 @@ internal fun createKType(
|
||||
) =
|
||||
KTypeImpl(classifier, arguments.asList(), isMarkedNullable)
|
||||
|
||||
@JsName("createDynamicKType")
|
||||
internal fun createDynamicKType(): KType = DynamicKType
|
||||
|
||||
@JsName("markKTypeNullable")
|
||||
internal fun markKTypeNullable(kType: KType) = KTypeImpl(kType.classifier!!, kType.arguments, true)
|
||||
|
||||
|
||||
@@ -45,6 +45,14 @@ internal class KTypeImpl(
|
||||
}
|
||||
}
|
||||
|
||||
internal object DynamicKType : KType {
|
||||
override val classifier: KClassifier? = null
|
||||
override val arguments: List<KTypeProjection> = emptyList()
|
||||
override val isMarkedNullable: Boolean = false
|
||||
override val annotations: List<Annotation> = emptyList()
|
||||
override fun toString(): String = "dynamic"
|
||||
}
|
||||
|
||||
internal fun KVariance.prefixString() =
|
||||
when (this) {
|
||||
KVariance.INVARIANT -> ""
|
||||
|
||||
Reference in New Issue
Block a user