Swift 6: Main actor-isolated property 'listener' cannot be used to satisfy nonisolated protocol requirement with RIBs 0.9.2

未关闭
#43 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
ios, swift
领域
mobile

调研方向

从 RIBs 模板以及 issue 中描述的生成 listener 属性和对应的协议要求开始。在 Xcode 中重现 Swift 6 构建,然后确定适用于生成代码和协议的兼容 actor 隔离处理方式;当新生成的 RIB 能够在没有隔离不匹配的情况下编译时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

When generating a new RIB using the RIBs template (version 0.9.2) under Swift 6, I encounter the following compiler error:

Main actor-isolated property 'listener' cannot be used to satisfy nonisolated protocol requirement

This happens because the generated code marks the listener property as @MainActor, but the corresponding protocol requirement is nonisolated.

Steps to Reproduce
1. Create a new RIB module using the RIBs template on version 0.9.2.
2. Build the project in Xcode with Swift 6 enabled.
3. Observe the compiler error above.

Expected Behavior

Generated RIB code should compile successfully under Swift 6 without actor isolation mismatches.

Actual Behavior

Compilation fails due to mismatch between @MainActor isolated property and nonisolated protocol requirement.

Environment
• RIBs version: 0.9.2
• Swift version: 6.0

Is there a recommended way to update the generated RIBs code (or RIBs framework itself) so that the listener property works correctly with Swift 6’s stricter actor isolation rules?
Should protocol definitions also be annotated with @MainActor, or is there an official workaround planned?

主要语言
Swift
星标
193
派生
25
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

uber/RIBs-iOS 的其他 Issue

查看 uber/RIBs-iOS 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。