POLYTONE — the AI-native programming language

Error Lab

Every diagnostic below is the real output of ptc, not a mock-up. Pick a mistake, read how the compiler teaches the canonical form, then flip to the fix.

A typo names its fix

A misspelt name is the cheapest error to repair — if the error says which name was meant. When exactly one name in scope is within two edits, POLYTONE names it; when two are equally close, it names neither rather than guess.

broken.pt
let price = 12
let quantity = 3
print("{price * quantty}")
The compiler answers
error: unknown name 'quantty' — did you mean 'quantity'? (line 3, column 17)

ptc fix repairs this by itself: Change 'quantty' to 'quantity'