diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/type-table.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/type-table.rkt index d4b06b5f..2bb45b6f 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/type-table.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/type-table.rkt @@ -123,11 +123,11 @@ (pretty-format-type (cleanup-type type))))] [(or (tc-results: types) (tc-results: types _ _ _ _)) ; FIXME, account for dty/dbound - (apply string-append - (for/list ([(type index) (in-indexed (in-list types))]) - (format "Value ~a:~n ~a~n" - (add1 index) - (printer-thunk type-names + (printer-thunk type-names + (apply string-append + (for/list ([(type index) (in-indexed (in-list types))]) + (format "Value ~a:~n ~a~n" + (add1 index) (pretty-format-type (cleanup-type type) #:indent 2)))))] [(tc-any-results: _) "AnyValues"])) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/tooltip-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/tooltip-tests.rkt index cdb24e56..42efcb70 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/tooltip-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/tooltip-tests.rkt @@ -70,12 +70,12 @@ (match-define (vector stx start* end* type*) tooltip) (printf "~a ~a ~a~n" start* end* (if (procedure? type*) (type*) type*)))) (for/and ([entry (in-list lst)]) - (match-define (list type start end) entry) + (match-define (list regex start end) entry) (for/or ([tooltip (in-list tooltips)]) (match-define (vector stx start* end* type*) tooltip) (and (= start start*) (= end end*) - (equal? type (if (procedure? type*) (type*) type*)))))) + (regexp-match? regex (if (procedure? type*) (type*) type*)))))) ;; ensures there are no duplicate type tooltips for a single syntax location (define (unique-locations? tooltips) @@ -90,9 +90,12 @@ (define tests (test-suite "Tooltip tests" (check-tooltip (string-append "foo" "bar") - (has-types-at? (list (list "String" 38 43)))) + (has-types-at? (list (list "^String$" 38 43)))) (check-tooltip (for/list : (Listof Integer) ([i (list 1 2 3)]) i) - (has-types-at? (list (list "(Listof Integer)" 23 24) - (list "(Listof Integer)" 72 73)))) + (has-types-at? (list (list "^\\(Listof Integer\\)$" 23 24) + (list "^\\(Listof Integer\\)$" 72 73)))) (check-tooltip (class object% (super-new) (field [x : Integer 0]) x (set! x 3)) - (has-types-at? (list (list "Integer" 74 75)))))) + (has-types-at? (list (list "^Integer$" 74 75)))) + (check-tooltip (values 1 2) + (has-types-at? (list (list #rx"Value 1:.*One.*Value 2:.*Positive-Byte" + 23 24))))))