Skip to content

MainActor and @AppStorage bridging fixes - #301

Open
kageroumado wants to merge 4 commits into
skiptools:mainfrom
kageroumado:android-fixes
Open

kageroumado wants to merge 4 commits into
skiptools:mainfrom
kageroumado:android-fixes

Conversation

@kageroumado

Copy link
Copy Markdown

Default MainActor isolation causes generated bridges to fail compilation or trap during peer release. Generic views using @AppStorage also fail to compile because their type-erased peers use the wrong support type.

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement

  • REQUIRED: I have tested my change locally with swift test

  • AI was used to generate or assist with generating this PR.

Claude Code assisted with the code; Codex edited this description. Reproduced and verified in a Skip Fuse app on an Android 16 emulator, in debug and release builds.

kageroumado and others added 4 commits October 13, 2026 22:28
A package with .defaultIsolation(MainActor.self) fails to compile the
generated bridge: the private …TypeErased class becomes main-actor
isolated, while toTypeErased() constructs it from a nonisolated context.
Mark the class nonisolated; modules with nonisolated default isolation
are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generated _Swift_release @_cdecl runs on the JVM finalizer daemon.
Under default MainActor isolation it inherits main-actor isolation and
traps on the executor check. Mark it nonisolated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bundle_Support.swift declares the init?(path:) and init(for:) interceptors
in an extension of AndroidBundle. In a module with default MainActor
isolation they become main-actor isolated, and the synthesized
Bundle.module, a nonisolated static, no longer compiles: "main
actor-isolated default value in a nonisolated context". Mark both
nonisolated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A generic view's type-erased peer declared Java_initState_x as
() -> SkipUI.StateSupport for an @AppStorage property, while the view's
own accessors produce AppStorageSupport, so the generated code did not
type-check. Pick the support type the way swiftUIInitState does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cla-bot cla-bot Bot added the cla-signed label Oct 13, 2026
@kageroumado kageroumado changed the title Android fixes MainActor and @AppStorage bridging fixes Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant