diff --git a/collects/tests/typed-racket/fail/flat-contract-name.rkt b/collects/tests/typed-racket/fail/flat-contract-name.rkt new file mode 100644 index 0000000000..5a5e8ca0d0 --- /dev/null +++ b/collects/tests/typed-racket/fail/flat-contract-name.rkt @@ -0,0 +1,14 @@ +#; +(exn-pred #rx"expected: 0") + +#lang racket + +;; The purpose of this test is to make sure that contract +;; errors for (Value x) types print in a good way + +(module a typed/racket + (define: (f [x : Zero]) : Zero x) + (provide f)) + +(require 'a) +(f "foo") diff --git a/collects/typed-racket/private/type-contract.rkt b/collects/typed-racket/private/type-contract.rkt index 0477a1e575..2a1d3ff9c8 100644 --- a/collects/typed-racket/private/type-contract.rkt +++ b/collects/typed-racket/private/type-contract.rkt @@ -422,7 +422,7 @@ [(Syntax: (Base: 'Symbol _ _ _ _)) #'identifier?] [(Syntax: t) #`(syntax/c #,(t->c t #:kind flat-sym))] - [(Value: v) #`(flat-named-contract #,(format "~a" v) (lambda (x) (equal? x '#,v)))] + [(Value: v) #`(flat-named-contract '#,v (lambda (x) (equal? x '#,v)))] ;; TODO Is this sound? [(Param: in out) (set-impersonator!)