This approach has problems that if we have helpers to throw errors, we won't see useful errors messages, unless we wrap those helpers explicitly in withFrozenCallStack. It's quite easy to forget to wrap. Morever, last position might not always be helpful. So I propose to change the data type to the following:
Currently we store only the last position of source code in error:
This approach has problems that if we have helpers to throw errors, we won't see useful errors messages, unless we wrap those helpers explicitly in
withFrozenCallStack
. It's quite easy to forget to wrap. Morever, last position might not always be helpful. So I propose to change the data type to the following:And change formatting function:
And ideally it would be nice to pretty-print this list... What are your ideas? Single source postion is formatted like this:
How would you format multiple errors?