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.
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)import mathx
print("{mathx.double(21)}")Fixed — and it runs
42