unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.75k stars 269 forks source link

Turn a possible “impossible” into a parse failure #5297

Closed sellout closed 1 month ago

sellout commented 1 month ago

Overview

From #5179, there’s a case where we hit an error "impossible", which doesn’t provide much context. This turns it into a parse failure, so we have #thte state of the lexer when this happens again. It also adds a comment that describes when this “impossible” case gets hit.

Test coverage

No coverage – this is to improve the diagnostics when this case gets hit again.

Loose ends

Ormolu is bad at formatting comments on conditional branches.

pchiusano commented 1 month ago

Thanks @sellout !