Inferred void class operations are never checked against the starter's return type

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

维护者通常 1 天内回复

@papaya0112 已经在做这个了。

开始于 2026年11月26日。

评估

这个 Issue 还没有评估数据。

描述

posed in scripts/problem_bank/rules.py publishes each class operation's kind in methodReturnTypes from the cases alone: an operation is "void" when every expected value for it is null. The C++ and Java harnesses already drop whatever a "void" operation returns, and #849 makes the JavaScript and Python runners do the same. A value-returning operation whose cases all happen to expect null would therefore be published as void and stop being compared in all four languages, so any return would pass.

Nothing checks the inference today. The test #849 adds only holds each kind to the spelling "void" or "value" and to the operations the cases call; it cannot tell a wrong kind from a right one, because the expected values it builds read the same field the runners do. The starters already state the real type, for example void push(int value) and int top() in the C++ starter of Tentative Bid Ledger.

Comparing each inferred kind with the return type the C++ starter declares, next to the inference in rules.py or as a check in tests/test_gen_problems.py, would fail when such a judge is generated. All eight served class judges agree with their starters today, so the check refuses nothing now. This was raised in the review of #849 and left out of that change.

主要语言
Rust
星标
236
派生
153
平均合并
1 天 9 小时
30 天内合并 PR
187

环境准备

从这里开始

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

sysprog21/codetrial 的其他 Issue

查看 sysprog21/codetrial 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

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