fix: execute typed members callback / 修复类型化成员回调执行 - #67
Merged
Merged
Conversation
Member
Author
|
@coderabbitai review |
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.
中文
关联 #63、calcit-lang/calcit#1529。修复一个已在正式 Calcit 0.27.0 复现的业务回调错误;不关闭完整路由迁移任务。
修改
twig-members的hint-fn与实际twig-member-entry调用改为函数体内的同级表达式。hint-fn返回 Nil,是类型元数据,不会执行/返回嵌在第二个参数里的回调 body。保留现有 Map<Number,String>、MapEntryDecision 与 keep/drop 合同,不添加 unsafe、扩大 Dynamic、转换业务 key 或改动路由协议。新增 definition
:tests,通过真实 nominal User/Session 构造器检查非空成员映射、数字键、无登录用户、缺失用户和空输入。类型断言只标记这些已构造值与空 Map 的精确集合合同,不替不可信数据补证明。原有 21 项测试不修改。验证
match expected an enum value, got: nil;修复后通过。使用正式 Calcit 0.27.0。本地模块与 npm 依赖通过只读链接使用现有缓存;没有修改原用户项目。Actions 会重新安装 deps.cirru 与 yarn.lock 的版本,作为干净依赖组合验证。未声称实际浏览器/WebSocket、完整路由 payload 迁移或正式 0.28/0.29 升级完成。
English
Refs #63 and calcit-lang/calcit#1529. Fix an application callback bug reproduced with published Calcit 0.27.0; this does not close the broader route migration.
Changes
Make the hint-fn metadata and twig-member-entry call sibling expressions in twig-members. The hint returns Nil rather than executing/returning a body nested as its second argument. Preserve Map<Number,String>, MapEntryDecision and keep/drop contracts; no unsafe additions, wider Dynamic, business-key conversions or protocol changes.
Add a definition-attached test using real nominal User/Session constructors to exercise nonempty mapping, numeric keys, unauthenticated/missing users and empty inputs. Assertions annotate the exact collection contracts of already-constructed values/empty Maps, not untrusted data. The existing 21 tests remain unchanged.
Validation
match expected an enum value, got: nil, then passes after the fix, using released Calcit 0.27.0.Local Calcit/npm dependencies are existing caches linked read-only; original user projects are untouched. Actions will reinstall the versions declared in deps.cirru/yarn.lock for clean-combination validation. No actual browser/WebSocket, complete route-payload migration or released 0.28/0.29 upgrade acceptance is claimed.