Skip to content

Fix wrong order, or redundant try/await in generated code which caused warnings - #503

Merged
ktoso merged 2 commits into
swiftlang:mainfrom
amanmaurya92:fix/jni-try-await-order
Jan 7, 2026
Merged

ktoso merged 2 commits into
swiftlang:mainfrom
amanmaurya92:fix/jni-try-await-order

Conversation

@amanmaurya92

@amanmaurya92 amanmaurya92 commented Dec 20, 2025 •

Copy link
Copy Markdown
Contributor

Fixes #471
&
Fixes #470.

The JNI Swift generator emitted await try for async throwing calls,
which produces Swift compiler warnings. This change ensures try await
is emitted correctly.

@ktoso

ktoso commented Jan 7, 2026

Copy link
Copy Markdown
Collaborator

Appreciate the attempt but if you ran swift test you'd notice this isn't correct and is adding try even to methods which don't need it. Please run tests to verify your fixes are actually complete

@ktoso ktoso changed the title Fixs warning of try await Fix wrong order, or redundant try/await in generated code which caused warnings Jan 7, 2026
@ktoso

ktoso commented Jan 7, 2026

Copy link
Copy Markdown
Collaborator

I took a stab at fixing this up, thanks for picking up the topic!

Next time please do run the tests locally and follow up to ensure they're passing 🙏

@ktoso
ktoso merged commit f241b47 into swiftlang:main Jan 7, 2026
49 checks passed
@amanmaurya92

Copy link
Copy Markdown
Contributor Author

@ktoso Thanks for jumping in and fixing it — I appreciate you taking the time.
Apologies for not running the tests locally before pushing; that’s on me.
I’ll make sure tests are run and verified next time so the contribution is solid and mistake-free. Thanks again for the guidance.

@ktoso

ktoso commented Jan 7, 2026

Copy link
Copy Markdown
Collaborator

No worries, thanks! Looking forward to more contributions :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

jextract warnings: jni mode should better handle void result calls to avoid warnings jextract generated code watnings: try must be before await

2 participants