Pre-alpha · Updated 2026-09-05

Compiler diagnostics, exactly as emitted.

pycc is a pre-alpha AOT compiler for typed Python. Inspect real T0021 human and JSON output, emitted help, placeholder spans, and diagnostic limitations.

diagnostics-v1 · compiler-diagnostic · all-Tier-1

Human output has no help line. The type checker uses a placeholder 1:1, zero-length span; the caret does not precisely highlight the argument. Exact serialization for this fixture does not establish diagnostic-class correctness for all inputs.

Execution transcript

source

for item in range("three"):
    print(item)

human command

pycc check tests/diagnostics/d0021_range_argument_type.py

human stdout

error[T0021]: range stop expects `int`, got `str`
 --> tests/diagnostics/d0021_range_argument_type.py:1:1
  |
1 | for item in range("three"):
  | ^ range stop expects `int`, got `str`

human stderr (empty)

human exit

1

json command

pycc check tests/diagnostics/d0021_range_argument_type.py --error-format json

json stdout

{"code":"T0021","format_version":1,"help":["pass an `int` value"],"message":"range stop expects `int`, got `str`","severity":"error","spans":[{"col":1,"file":"tests/diagnostics/d0021_range_argument_type.py","label":"range stop expects `int`, got `str`","len":0,"line":1}]}

json stderr (empty)

json exit

1

Immutable execution provenance

Working directory: repository-root. Rust 1.97.1; LLVM 22; CPython 3.14.7; debug build; no extra compiler flags. The JSON execution explicitly selects --error-format json. CPython 3.14.7 was installed in CI but is not a dependency of either diagnostic command.

Source commit 0d94ad8f30b27131a5da381a034d55165558e56a, tree 26bf9fe465c50d8065b1e0260e6100dc3e68f193. CI run 33969157527 checked out merge commit 321e66ff71f1eb4dedcd34d606f98994ad198758, whose complete tree equals the source tree; base 4eca5e24e09d6972b5717f35652e5201dde2a02f. These are historical execution facts, not a claim that the publication commit was already tested.

Registered production test: diagnostics_commands_match_human_and_json_snapshots.

fixture · test · commit · run · human · json

What the output does—and does not—prove

The human transcript is the actual stdout of a rejected range argument. JSON separately carries "help":["pass an `int` value"]. The human renderer does not print a help line. No automatic repair is offered here; --fix is not implemented.

The line 1, column 1 caret comes from a zero-length placeholder span, not precise argument highlighting. Stable serialization is evidence for these exact bytes, not evidence that every valid, invalid, unsupported, or type-incorrect program is classified correctly. Known classification boundaries and gaps are recorded in the current diagnostics registry.

Explore the actual contracts

pycc explain T0021 is an implemented explanation lookup, not another occurred diagnostic. Read its registered explanation and tests and the CLI explanation tests; no explanation transcript is invented here.

Additional real snapshots include a function argument type mismatch and the diagnostic fixture collection. The current CLI contract defines exit codes and output formats.

Keep the evidence in context

Read language support and its limits, exact compiler diagnostics, current implementation status, and the compiler architecture. The current roadmap describes evolving scope; links labeled current may advance beyond this historical run.