From c1b0dba1d229a72d13bb017436caf820c8630b68 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Fri, 22 Sep 2017 16:31:07 +0300 Subject: [PATCH] Add quickfix for unsupported types in Objective-C methods --- .../org/jetbrains/kotlin/native/interop/indexer/Indexer.kt | 4 ++++ 1 file changed, 4 insertions(+) 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 544a41577d9..49ca11de5e5 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 @@ -752,6 +752,10 @@ internal class NativeIndexImpl(val library: NativeLibrary) : NativeIndex() { val returnType = convertType(clang_getCursorResultType(cursor), clang_getCursorResultTypeAttributes(cursor)) val parameters = getFunctionParameters(cursor) + if (returnType == UnsupportedType || parameters.any { it.type == UnsupportedType }) { + return null // TODO: make a more universal fix. + } + val isClass = when (cursor.kind) { CXCursorKind.CXCursor_ObjCClassMethodDecl -> true CXCursorKind.CXCursor_ObjCInstanceMethodDecl -> false