Skip to content

fix(android): make Kotlin callbacks invariant - #2031

Merged
mrousavy merged 1 commit into
v1from
mrousavy/fix-kotlin-callback-variance
Nov 2, 2026
Merged

mrousavy merged 1 commit into
v1from
mrousavy/fix-kotlin-callback-variance

Conversation

@mrousavy

@mrousavy mrousavy commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Make Callback<F> invariant so Kotlin rejects implicit signature changes, such as Callback<() -> Double> to Callback<() -> Double?>, before they reach JNI. Inline Callback.native construction still infers the receiving API's function type.

Validated core and generated fixture Kotlin builds, Kotlin formatting, accepted exact/inline callbacks, and rejected return/parameter variance conversions. Cross-module nested callback storage remains a separate issue.

@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
nitro-docs Skipped Skipped Nov 2, 2026 12:13pm UTC

Request Review

@mrousavy
mrousavy force-pushed the mrousavy/fix-kotlin-callback-variance branch from 8fec8bc to 0c0adaa Compare November 2, 2026 12:13
@mrousavy mrousavy changed the title fix(android): adapt Kotlin callback variance safely fix(android): make Kotlin callbacks invariant Nov 2, 2026
@mrousavy
mrousavy merged commit 8e76aca into v1 Nov 2, 2026
5 of 13 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 0c0adaa6 Deployed Nov 2, 2026 by vercel[bot]
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.

1 participant