[Ur] typechecker rejects form handler

Adam Chlipala adamc at csail.mit.edu
Sun Jan 5 13:15:46 EST 2014

On 01/04/2014 02:43 PM, Jason Gross wrote:
> As an idea to improve error messages, would it be possible to tag 
> unification hints with where they come from, so that the error message 
> would include something like "... constraint comes from passing 
> 's.Text' as an argument to postfix '!'" or something?

That's an interesting idea.  My first reaction is that the extra 
information you're suggesting is easy to deduce by inspecting the code.  
A unification failure for an expression is only triggered in the context 
of its immediately enclosing parent expression.

However, I'd never before considered the consequences of parsing 
misunderstandings like this one!  Effectively, shouting out the kind of 
enclosing parent expression could help the user see how the code is 
really being parsed.

At the same time, chattier type inference output can make messages 
harder to read in the common case, and I've never seen this particular 
kind of error come up in the wild before.  So, for now, I think I'll 
leave the error messages alone, but I'll keep your suggestion in mind.

More information about the Ur mailing list