A shape lists methods that a type must have to fit it. Each method must take self first, and
a shape itself can't have type parameters (inside a shape, Self names the fitting type).
Wrong#
shape Area { fn area(): float }Fixed#
shape Area { fn area(self): float }Common causes#
- A method without
self: shapes only describe methods called on a value. shape Cmp<T> { ... }: drop the parameter and useSelf(fn cmp(self, o: Self): int).