Interop/StubGenerator: fix regressions after refactoring
performed to support callbacks
This commit is contained in:
+11
-1
@@ -374,7 +374,7 @@ class StubGenerator(
|
|||||||
|
|
||||||
is RecordType -> {
|
is RecordType -> {
|
||||||
val refType = getKotlinTypeForRefTo(type)
|
val refType = getKotlinTypeForRefTo(type)
|
||||||
InValueBinding(
|
return InValueBinding(
|
||||||
kotlinJniBridgeType = "Long",
|
kotlinJniBridgeType = "Long",
|
||||||
conv = { "NativePtr.byValue($it).asRef(${refType.typeExpr})!!" },
|
conv = { "NativePtr.byValue($it).asRef(${refType.typeExpr})!!" },
|
||||||
kotlinType = refType.typeName
|
kotlinType = refType.typeName
|
||||||
@@ -386,6 +386,16 @@ class StubGenerator(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getCallbackParamBinding(type: Type): InValueBinding {
|
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)
|
return getInValueBinding(type)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user