diff --git a/collects/typed-scheme/core.rkt b/collects/typed-scheme/core.rkt index 190932dd..37052281 100644 --- a/collects/typed-scheme/core.rkt +++ b/collects/typed-scheme/core.rkt @@ -42,6 +42,7 @@ ;; use the regular %#module-begin from `racket/base' for top-level printing (arm #`(#%module-begin optimized-body ... #,after-code check-syntax-help))))))])) +(define did-I-suggest-:print-type-already? #f) (define (ti-core stx) (syntax-parse stx [(_ . ((~datum module) . rest)) @@ -62,17 +63,22 @@ ;; Don't display the whole types at the REPL. Some case-lambda types ;; are just too large to print. (let ([tc (cleanup-type t)]) - (format "- : ~a~a\n" tc (if (equal? tc t) - "" - "\nUse :print-type to see more.")))] + (format "- : ~a~a\n" + tc (if (or did-I-suggest-:print-type-already? + (equal? tc t)) + "" + (begin (set! did-I-suggest-:print-type-already? #t) + "\nUse :print-type to see more."))))] [(tc-results: t) (define new-ts (map cleanup-type t)) (format "- : ~a~a\n" (cons 'Values new-ts) ;; did any get pruned? - (if (not (andmap equal? t new-ts)) - " \nUse :print-type to see more." - ""))] + (if (or did-I-suggest-:print-type-already? + (andmap equal? t new-ts)) + "" + (begin (set! did-I-suggest-:print-type-already? #t) + " \nUse :print-type to see more.")))] [x (int-err "bad type result: ~a" x)])]) (if ty-str #`(let ([type '#,ty-str])