fix(notifications): Kotlin Function block return type for openSettings#21
Merged
teslashibe merged 1 commit intomainfrom Apr 22, 2026
Merged
Conversation
EAS Android build for v0.8.0 failed in :notification-capture:compileReleaseKotlin
with:
e: NotificationCaptureModule.kt:51:50 Return type mismatch:
expected 'Any?', actual 'Unit'.
The Expo Modules `Function` DSL infers its return type from the lambda
body. Single-expression bodies that evaluate to Unit (e.g. setEnabled,
setAllowlist) compile fine because Kotlin promotes Unit to Any?. But
openSettings used an early `return@Function` (no value) followed by a
tail Unit expression, which forced the inferred return type to Unit and
clashed with the DSL's Any? overload selection.
Fix: replace the early-return idiom with a `?.let { ... }` scope so the
lambda has a single tail expression (the let returns Unit?, which the
compiler happily widens to Any?).
Pure compile fix — no behavioural change. Verified by a clean local
re-read of the surrounding Function blocks; no other early-return
patterns in the module.
Re-trigger EAS build after merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EAS Android build for v0.8.0 failed in `:notification-capture:compileReleaseKotlin`:
```
e: NotificationCaptureModule.kt:51:50 Return type mismatch:
expected 'Any?', actual 'Unit'.
```
The Expo Modules `Function` DSL infers its return type from the lambda body. Single-expression bodies that evaluate to Unit (e.g. `setEnabled`, `setAllowlist`) compile fine because Kotlin promotes Unit to Any?. But `openSettings` used an early `return@Function` (no value) followed by a tail Unit expression, which forced the inferred return type to Unit and clashed with the DSL's Any? overload selection.
Fix: replace the early-return idiom with a `?.let { ... }` scope so the lambda has a single tail expression (the let returns Unit?, which the compiler happily widens to Any?).
Pure compile fix — no behavioural change.
Test plan