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.

No dropped results

Calling a function and ignoring its value is almost always a bug — a missing let, a forgotten return. POLYTONE turns it into a compile error.

broken.pt
fn build() -> Int = 42
build()
The compiler answers
error: this Int result is discarded — bind it with 'let' or return it (line 2, column 1)