[plt-dev] slightly misleading error

From: Dave Herman (dherman at ccs.neu.edu)
Date: Fri May 22 14:48:25 EDT 2009

This code:

     (define (foo) (values 'a 'b))
     (let ([x (foo)]) x)

highlights the expression (values 'a 'b) and produces the error message:

     context expected 1 value, received 2 values: a b

The highlighted expression was the producer, but the message was about 
the context. This confused me when it happened to me, because I assumed 
the highlighted expression /was/ the context, and set about hopelessly 
trying to figure out what *inside* that expression had produced the 
wrong number of values.

This is one of those "two parties disagree but there's no expressed 
contract" kinds of errors, so highlighting either party is reasonable, 
but the error message should probably be consistent with what's 
highlighted in order to avoid this confusion.


Posted on the dev mailing list.