Skip to content

Commit

Permalink
Fix return signatures with arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
romainguy committed May 17, 2024
1 parent df99606 commit 23c7775
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ compose.desktop {

targetFormats(TargetFormat.Dmg)

packageVersion = "1.2.0"
packageVersion = "1.2.1"
packageName = "Kotlin Explorer"
description = "Kotlin Explorer"
vendor = "Romain Guy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ suspend fun buildAndDisassemble(
) = coroutineScope {
val ui = currentCoroutineContext()

onLogs(showLogs(""))

launch(Dispatchers.IO) {
val updater = ProgressUpdater(TotalDisassemblySteps, onStatusUpdate)
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,21 @@ private fun jniTypeToJavaType(
.replace('/', '.')
.replace("java.lang.", "")
}

'S' -> "short"
'V' -> "void"
'Z' -> "boolean"
else -> "<unknown>"
} to endIndex + 1
}

private fun returnTypeFromType(type: String): String = jniTypeToJavaType(type, type.lastIndexOf(')') + 1).first
private fun returnTypeFromType(type: String): String {
val index = type.lastIndexOf(')') + 1
when (type[index]) {
'[' -> {
return jniTypeToJavaType(type, index + 1).first + "[]"
}
else -> {
return jniTypeToJavaType(type, index).first
}
}
}

0 comments on commit 23c7775

Please sign in to comment.