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.
Errors that list your options
A typo'd method name doesn't just fail — the diagnostic enumerates every method the receiver actually has.
let xs = [3, 1, 2]
let n = xs.size()The compiler answers
error: no method 'size' on List[Int] — available methods: len, is_empty, contains, first, last, reversed, sorted, join, map, filter, fold, push (line 2, column 9)let xs = [3, 1, 2]
let n = xs.len()
print("{n}")Fixed — and it runs
3