Skip to content

jextract warnings: jni mode should better handle void result calls to avoid warnings #471

@ktoso

Description

@ktoso

jextract JNI source generation should handle void calls better, since we're getting warnings:

/Users/ktoso/code/swift-java/Samples/SwiftJavaExtractJNISampleApp/.build/plugins/outputs/swiftjavaextractjnisampleapp/MySwiftLibrary/destination/JExtractSwiftPlugin/Sources/MySwiftLibraryModule+SwiftJava.swift:472:13: warning: constant 'swiftResult$' inferred to have type '()', which may be unexpected
470 |       } // printTaskBody(printer:) @ JExtractSwiftLib/JNISwift2JavaGenerator+NativeTranslation.swift:976
471 |       do {
472 |         let swiftResult$ = await try MySwiftLibrary.asyncThrows()
    |             |- warning: constant 'swiftResult$' inferred to have type '()', which may be unexpected
    |             `- note: add an explicit type annotation to silence this warning

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions