Hard won lessons – Swift Type Checker

The root cause of a warning “Unable to type-check this expression” is not always inside the source file where it appears. I made a typo in computed property in a model object that caused the entire body to fail on the main screen.

After breaking it up into dozens of pieces trying to isolate the problem, it appeared as a different, still confusing error. But that error lead to the fix - changing a computed property from an optional into an Int.

In hindsight I should have just kept commenting out sections of the body until I’d isolated the culprit, rather than break it into sub-expressions.