Skip to content

Commit 1d771bd

Browse files
committed
prefix boolean variables with is to match Java conventions
1 parent 3cab67b commit 1d771bd

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

Sources/JExtractSwiftLib/FFM/FFMSwift2JavaGenerator+JavaTranslation.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ extension FFMSwift2JavaGenerator {
126126
let loweredSignature = try lowering.lowerFunctionSignature(decl.functionSignature)
127127

128128
// Name.
129+
let returnsBoolean = decl.functionSignature.result.type.asNominalTypeDeclaration?.knownTypeKind == .bool
129130
let javaName = switch decl.apiKind {
130131
case .getter: decl.javaGetterName
131132
case .setter: decl.javaSetterName

Sources/JExtractSwiftLib/ImportedDecls.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public final class ImportedFunc: ImportedDecl, CustomStringConvertible {
9191
}
9292
return false
9393
}
94-
94+
9595
/// If this function/method is member of a class/struct/protocol,
9696
/// this will contain that declaration's imported name.
9797
///

Sources/JExtractSwiftLib/JNI/JNISwift2JavaGenerator+JavaTranslation.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ extension JNISwift2JavaGenerator {
3838
let parentName = decl.parentType?.asNominalType?.nominalTypeDecl.qualifiedName ?? swiftModuleName
3939

4040
// Name.
41+
let returnsBoolean = translatedFunctionSignature.resultType == .boolean
4142
let javaName = switch decl.apiKind {
4243
case .getter: decl.javaGetterName
4344
case .setter: decl.javaSetterName

0 commit comments

Comments
 (0)