plt/racket — pull request #526 by takikawa (2013-12-18 05:16:52+00:00)
Title: Start on new error message format for Typed Racket

This PR starts to convert TR error messages to the new Racket format detailed here: http://www.cs.utah.edu/plt/snapshots/current/doc/reference/exns.html#%28part._err-msg-conventions%29

The new errors are raised with the `tc-error/fields` and `tc-error/expr/fields` functions, which are used like `raise-arguments-error`. I've only converted the uses of `tc-error` in the `check-below.rkt` file so far. If this looks good, I'll work on converting other uses.

Here is some sample output from these changes:

````
; readline-input:2:16: Type Checker: type mismatch
; expected: String
; given: (List a ... a)
; in: x
; [,bt for context]

; readline-input:2:12: Type Checker: type mismatch
; mismatch in number of values
; expected: 1
; given: 1
; in: (vector 1 2)
; [,bt for context]

; readline-input:2:16: Type Checker: type mismatch
; mismatch in number of values
; expected: 0 values and `a ...'
; given: 1 values
; in: x
; [,bt for context]

; readline-input:4:16: Type Checker: type mismatch
; type variables bound in different scopes
; expected: a
; given: a
; in: x
; [,bt for context]
````

These changes pass the tests, but I haven't thoroughly checked all the error message cases to make sure the messages look good. I'll do that later.