diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-app-helper.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-app-helper.rkt index 81c5d150..c8ecbb75 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-app-helper.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-app-helper.rkt @@ -105,7 +105,8 @@ (if tail-bound (cons tail-ty tail-bound) #f))) (cond [(null? doms) - (int-err "How could doms be null: ~a" ty)] + (tc-error/expr "cannot apply function of type Procedure" + #:return return)] [(and (= 1 (length doms)) (not (car rests)) (not (car drests)) (not tail-ty) (not tail-bound)) (tc-error/expr #:return return diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt index 72538fb2..d7eb57de 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt @@ -3106,6 +3106,13 @@ ((if (even? 4) add1 (inst values Integer)) 4) -Int] + ;; PR 14601 + [tc-err + (let () + (: f Procedure) + (define f (lambda () 'hi)) + (f)) + #:msg "cannot apply function of type Procedure"] ) (test-suite