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

Open
#871 1 comment 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@papaya0112 is already working on this.

Since Nov 26, 2026.

Assessment

This issue has not been assessed yet.

Description

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.

Dominant language
Rust
Stars
236
Forks
153
Avg merge
1d 9h
Merged PRs (30d)
187

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sysprog21/codetrial

All issues in sysprog21/codetrial

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.