Handle variadic block types in cinterop

#KT-36766 Fixed
This commit is contained in:
SvyatoslavScherbina
2020-04-15 14:24:21 +03:00
committed by GitHub
parent 9722e32741
commit 7866c46bc7
3 changed files with 8 additions and 1 deletions
@@ -688,7 +688,7 @@ internal class NativeIndexImpl(val library: NativeLibrary, val verbose: Boolean
private fun convertFunctionType(type: CValue<CXType>): 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.
@@ -0,0 +1 @@
void kt36766(void (^block)()) {}
@@ -0,0 +1,6 @@
import kotlin.test.*
import objcTests.*
@Test fun testKt36766() {
kt36766(null)
}