chalk
chalk copied to clipboard
Add inference variable info in debug output
To print debug info that is not present in the internal representation of terms in chalk (struct and trait names, for example) we use a thread local storage, all info relevant to debug representation is stored there.
For example, when somebody tries to print a struct with id 1
, Debug
implementation for structs checks if debug info is present in the tls and if it is, finds the name of the struct with id 1
and prints it. If it is not, it just prints 1
.
Currently, we don't store inference table in the tls, so when printing inference variables we can't know their universe or whether they are bound to a value or not.
(My) suggested solution is to have something like debug_ex_clause
but for inference tables, but you are welcome to experiment with it 🙃 , there is surely a design space