diff --git a/typed-racket-lib/typed-racket/private/type-contract.rkt b/typed-racket-lib/typed-racket/private/type-contract.rkt index c734ccff..cd7a6e85 100644 --- a/typed-racket-lib/typed-racket/private/type-contract.rkt +++ b/typed-racket-lib/typed-racket/private/type-contract.rkt @@ -145,11 +145,14 @@ (and (identifier? ctc-stx) (let ([match? (assoc ctc-stx (hash-values cache) free-identifier=?)]) (and match? - ;; ->* are handled specially by the contract system - (let ([sexp (syntax-e (cdr match?))]) - (and (pair? sexp) - (or (free-identifier=? (car sexp) #'->) - (free-identifier=? (car sexp) #'->*)))) + (or + ;; no need to generate an extra def for things that are already identifiers + (identifier? match?) + ;; ->* are handled specially by the contract system + (let ([sexp (syntax-e (cdr match?))]) + (and (pair? sexp) + (or (free-identifier=? (car sexp) #'->) + (free-identifier=? (car sexp) #'->*))))) (cdr match?))))) ;; The below requires are needed since they provide identifiers that diff --git a/typed-racket-lib/typed-racket/static-contracts/instantiate.rkt b/typed-racket-lib/typed-racket/static-contracts/instantiate.rkt index bca74d72..9ac77dfa 100644 --- a/typed-racket-lib/typed-racket/static-contracts/instantiate.rkt +++ b/typed-racket-lib/typed-racket/static-contracts/instantiate.rkt @@ -144,7 +144,7 @@ (make-contract sc)] [else (define ctc (make-contract sc)) - (cond [cache + (cond [(and (not (identifier? ctc)) cache) (define fresh-id (generate-temporary)) (hash-set! cache sc (cons fresh-id ctc)) (set! sc-queue (cons sc sc-queue))