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.

pub is the export

A module's API is exactly its pub functions — and pub requires a doc comment, so exporting means documenting.

broken.pt
import mathx
print("{mathx.square(3)}")
The compiler answers
error: 'square' exists in module 'mathx' but is not public — mark it 'pub fn' (with a /// doc comment) in mathx.pt (line 2, column 9)