mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
![]() To provide better error messages and suggestions related to changing type annotations, we now pass annotation type signatures all the way down through the constraint solver. At constraint generation we associate the type signature with a unique variable, and during error reporting, we pull out an `ErrorType` corresponding to the original type signature, by looking up the unique variable. This gives us two nice things: 1. It means we don't have to pass the original, AST-like type annotation, which can be quite large, to everyone who looks at an expectation. 2. It gives us a translation from a `Type` to an `ErrorType` for free using the existing translation procedure in `roc_types::subs`, without having to create a new translation function. |
||
---|---|---|
.. | ||
src | ||
tests | ||
Cargo.toml |