diff --git a/collects/typed-scheme/typecheck/tc-app-helper.ss b/collects/typed-scheme/typecheck/tc-app-helper.ss index e228c754..220b26f8 100644 --- a/collects/typed-scheme/typecheck/tc-app-helper.ss +++ b/collects/typed-scheme/typecheck/tc-app-helper.ss @@ -19,31 +19,42 @@ (format "~a~a *~a" doms-string rst rng-string)] [else (string-append (stringify (map make-printable dom)) rng-string)]))) -(define (domain-mismatches ty doms rests drests rngs arg-tys tail-ty tail-bound #:expected [expected #f]) +(define (domain-mismatches ty doms rests drests rngs arg-tys tail-ty tail-bound + #:expected [expected #f]) (define arguments-str - (stringify-domain arg-tys (if (not tail-bound) tail-ty #f) (if tail-bound (cons tail-ty tail-bound) #f))) + (stringify-domain arg-tys + (if (not tail-bound) tail-ty #f) + (if tail-bound (cons tail-ty tail-bound) #f))) (cond [(null? doms) (int-err "How could doms be null: ~a ~a" ty)] [(= 1 (length doms)) - (format "Domain: ~a~nArguments: ~a~n~a" - (stringify-domain (car doms) (car rests) (car drests)) - arguments-str - (if expected - (format "Result type: ~a~nExpected result: ~a~n" - (car rngs) (make-printable expected)) - ""))] + (string-append + "Domain: " + (stringify-domain (car doms) (car rests) (car drests)) + "\nArguments: " + arguments-str + "\n" + (if expected + (format "Result type: ~a\nExpected result: ~a\n" + (car rngs) (make-printable expected)) + ""))] [else - (format "~a: ~a~nArguments: ~a~n~a" - (if expected "Types" "Domains") - (stringify (if expected - (map stringify-domain (map make-printable doms) rests drests rngs) - (map stringify-domain (map make-printable doms) rests drests)) - "~n\t") - arguments-str - (if expected - (format "Expected result: ~a~n" (make-printable expected)) - ""))])) + (let ([label (if expected "Types: " "Domains: ")] + [nl+spc (if expected "\n " "\n ")] + [pdoms (map make-printable doms)]) + (string-append + label + (stringify (if expected + (map stringify-domain pdoms rests drests rngs) + (map stringify-domain pdoms rests drests)) + nl+spc) + "\nArguments: " + arguments-str + "\n" + (if expected + (format "Expected result: ~a\n" (make-printable expected)) + "")))])) (define (poly-fail t argtypes #:name [name #f] #:expected [expected #f]) (match t