M-CHAT-A2 P0 | ChatEntryContext 未声明 Hashable,Route 编译失败 #56
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
发现
Route 声明为
enum Route: Hashable,aiChat case 有 associated value:Optional<T: Hashable> 是 Hashable,但 ChatEntryContext 未声明 Hashable 协议。
Swift 不会为未显式声明 Hashable 的结构体自动合成 Hashable(即使所有字段都是 Hashable)。
修复
ChatEntryContext 声明 Hashable:
涉及文件
修复
ChatEntryContext 声明 Hashable 协议。所有字段均为 Hashable,Swift 自动合成。
涉及: APIModels.swift