diff --git a/Interop/Indexer/src/main/kotlin/org/jetbrains/kotlin/native/interop/indexer/Indexer.kt b/Interop/Indexer/src/main/kotlin/org/jetbrains/kotlin/native/interop/indexer/Indexer.kt index b59e2074118..6171596b049 100644 --- a/Interop/Indexer/src/main/kotlin/org/jetbrains/kotlin/native/interop/indexer/Indexer.kt +++ b/Interop/Indexer/src/main/kotlin/org/jetbrains/kotlin/native/interop/indexer/Indexer.kt @@ -688,7 +688,7 @@ internal class NativeIndexImpl(val library: NativeLibrary, val verbose: Boolean private fun convertFunctionType(type: CValue): Type { val kind = type.kind - assert(kind == CXType_Unexposed || kind == CXType_FunctionProto) + assert(kind == CXType_Unexposed || kind == CXType_FunctionProto || kind == CXType_FunctionNoProto) { kind } if (clang_isFunctionTypeVariadic(type) != 0) { return VoidType // make this function pointer opaque. diff --git a/backend.native/tests/interop/objc/tests/kt36766.h b/backend.native/tests/interop/objc/tests/kt36766.h new file mode 100644 index 00000000000..06105e139b5 --- /dev/null +++ b/backend.native/tests/interop/objc/tests/kt36766.h @@ -0,0 +1 @@ +void kt36766(void (^block)()) {} \ No newline at end of file diff --git a/backend.native/tests/interop/objc/tests/kt36766.kt b/backend.native/tests/interop/objc/tests/kt36766.kt new file mode 100644 index 00000000000..a5a28003ceb --- /dev/null +++ b/backend.native/tests/interop/objc/tests/kt36766.kt @@ -0,0 +1,6 @@ +import kotlin.test.* +import objcTests.* + +@Test fun testKt36766() { + kt36766(null) +} \ No newline at end of file