From d4facccc6d53384e1b1f62d80eaf2ecfc4ad48d8 Mon Sep 17 00:00:00 2001 From: Sergey Bogolepov Date: Fri, 3 Apr 2020 14:29:18 +0700 Subject: [PATCH] [StubIr][Metadata] Add support for ObjCBlockVar type --- .../jetbrains/kotlin/native/interop/gen/KotlinCodeModel.kt | 3 +++ .../org/jetbrains/kotlin/native/interop/gen/StubIrType.kt | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/KotlinCodeModel.kt b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/KotlinCodeModel.kt index 10d72facab9..3eee8aac1b2 100644 --- a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/KotlinCodeModel.kt +++ b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/KotlinCodeModel.kt @@ -217,6 +217,9 @@ object KotlinTypes { val objCObjectBase by InteropClassifier val objCObjectBaseMeta by InteropClassifier + val objCBlockVar by InteropClassifier + val objCNotImplementedVar by InteropClassifier + val cValue by InteropClassifier private open class ClassifierAtPackage(val pkg: String) { diff --git a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/StubIrType.kt b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/StubIrType.kt index 6992f8da2fb..1e87c70bbae 100644 --- a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/StubIrType.kt +++ b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/StubIrType.kt @@ -190,6 +190,11 @@ private object PredefinedTypesHandler { return AbbreviatedType(cPointer, KotlinTypes.cArrayPointer, typeArguments, nullable) } + private fun expandObjCBlockVar(typeArguments: List, nullable: Boolean): AbbreviatedType { + val underlyingType = ClassifierStubType(KotlinTypes.objCNotImplementedVar, typeArguments, nullable) + return AbbreviatedType(underlyingType, KotlinTypes.objCBlockVar, typeArguments, nullable) + } + /** * @return [ClassifierStubType] if [classifier] is a typealias from [kotlinx.cinterop] package. */ @@ -201,6 +206,7 @@ private object PredefinedTypesHandler { KotlinTypes.cPointerVar -> expandCPointerVar(typeArguments, nullable) KotlinTypes.objCObjectMeta -> expandObjCObjectMeta(typeArguments, nullable) KotlinTypes.cArrayPointer -> expandCArrayPointer(typeArguments, nullable) + KotlinTypes.objCBlockVar -> expandObjCBlockVar(typeArguments, nullable) else -> null }