From 6d043204712616be232a01d6cb1272a44e69b3b6 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Fri, 14 Oct 2016 16:03:14 +0300 Subject: [PATCH] Interop/StubGenerator: fix regressions after refactoring performed to support callbacks --- .../kotlin/native/interop/gen/jvm/StubGenerator.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/StubGenerator.kt b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/StubGenerator.kt index 40f3f140f56..3939343b015 100644 --- a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/StubGenerator.kt +++ b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/StubGenerator.kt @@ -374,7 +374,7 @@ class StubGenerator( is RecordType -> { val refType = getKotlinTypeForRefTo(type) - InValueBinding( + return InValueBinding( kotlinJniBridgeType = "Long", conv = { "NativePtr.byValue($it).asRef(${refType.typeExpr})!!" }, kotlinType = refType.typeName @@ -386,6 +386,16 @@ class StubGenerator( } fun getCallbackParamBinding(type: Type): InValueBinding { + when (type) { + is RecordType -> { + val refType = getKotlinTypeForRefTo(type) + return InValueBinding( + kotlinJniBridgeType = "Long", + conv = { throw UnsupportedOperationException() }, + kotlinType = refType.typeName + ) + } + } return getInValueBinding(type) }