DrSmoothl
15a6fe3785
refactor(onebot): make event converter dispatch an exhaustive registry
阶段 2(零行为改动):把 convertEvent 的 17-arm switch 换成
CONVERTERS: { [K in QQEventVariant['kind']]: ConverterFor<K> | null } 表。mapped
type 对事件类型联合 total——新增一个 kind 却漏写 converter 会**编译报错**,而非
像原 switch 那样静默走 default: return null。
- ptt_trans_result(内部语音转文字事件,不对外)在表里显式标 null,与原 default
行为等价。
- 派发一次 localized cast 解 correlated-union,纯类型层、运行时等价。
- 护栏实测有效:删任一 kind 条目即 TS2741 编译失败。
onebot 516 全绿、typecheck 干净;对抗性 Agent 逐一核对 17 映射、独立复现护栏报错。
2026-07-01 18:03:02 +08:00
..
2026-05-21 10:26:29 +08:00
2026-07-01 18:03:02 +08:00
2026-07-01 16:20:26 +08:00
2026-06-30 20:38:37 +08:00
2026-05-21 08:52:00 +08:00
2026-05-21 10:26:29 +08:00