Intermediate
Never Forget a Case
A new shape, the triangle, was added to Shape, but area doesn't handle it, and assertNever complains. Read the error: it names the missing type.
Add the missing case returning (base * height) / 2. Keep the assertNever call in the default branch.
What Check tests
- Your code has no type errors
- The console prints
16and6 assertNeveris still used- An unknown kind is rejected
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Press Run to see the page.
Console
Nothing printed yet.