Skip to content

Commit 6c4d9f7

Browse files
committed
Skip printing JNICache for non enum types.
1 parent 32e7af7 commit 6c4d9f7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Sources/JExtractSwiftLib/JNI/JNISwift2JavaGenerator+SwiftThunkPrinting.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ extension JNISwift2JavaGenerator {
174174
}
175175

176176
private func printJNICache(_ printer: inout CodePrinter, _ type: ImportedNominalType) {
177+
if type.cases.isEmpty {
178+
return
179+
}
180+
177181
printer.printBraceBlock("enum \(JNICaching.cacheName(for: type))") { printer in
178182
for enumCase in type.cases {
179183
guard let translatedCase = translatedEnumCase(for: enumCase) else { continue }

0 commit comments

Comments
 (0)