Diagnostic and cause
링크Range step is zero
- 계열
- topaz
- 단계
- run
- 코드
TPZ4003
원인과 조건
Constructing a range with a computed int step of zero faults before the range can be iterated.
관련 규칙 · Trigger and repair →대응
Pass a nonzero step. Use a negative step only with descending endpoints; the repair changes the step to one for 0..5.
Compiler phase: runtime.
Compiler explanation: A range value used zero as its step.
Message templates are Pending. The explanation above is not an observed CLI message.
The evaluated range step is zero. Range construction requires a nonzero int step so traversal can make progress.
Trigger and repair
Constructing a range with a computed int step of zero faults before the range can be iterated.
Response
링크Pass a nonzero step. Use a negative step only with descending endpoints; the repair changes the step to one for 0..5.
Reproduction and verification
링크Product diagnostic test
링크function collect(step: int) -> () {for value in (0..5 by step) { value }()}collect(0)
기대 결과
기대 결과
The separate diagnostic product test validates this command, runtime diagnostic, or filesystem setup. The shared example runner does not execute that assertion plan.
Run topaz run example..
Expect exit status 1, empty standard output, and TPZ4003.
The evaluated range step is zero. Range construction requires a nonzero int step so traversal can make progress.
The primary location is example..
Expect exactly one diagnostic.
The diagnostic product test checks these expectations with the same files and command.
Corrected program
링크function collect(step: int) -> () {for value in (0..5 by step) { value }()}collect(1)
표준 출력 없음.기대 결과
기대 결과
실행을 마칩니다. 종료 코드 0.
This program applies the repair described above. The verification status records whether it has been run.