Interop/StubGenerator: fix regressions after refactoring

performed to support callbacks
This commit is contained in:
Svyatoslav Scherbina
2016-10-14 16:03:14 +03:00
parent 2d2c79c54c
commit 6d04320471
@@ -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)
}