diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-funapp.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-funapp.rkt index b7f3cc8d..a9a71d14 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-funapp.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-funapp.rkt @@ -160,7 +160,7 @@ (for/list ([fty ts]) (tc/funapp f-stx args-stx fty args-res expected)))] ;; error type is a perfectly good fcn type - [(Error:) f-type] + [(Error:) (ret f-type)] ;; otherwise fail [(Poly: ns (Function: arrs)) (tc-error/expr diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/fail/pr14615.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/fail/pr14615.rkt new file mode 100644 index 00000000..fb5e18d4 --- /dev/null +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/fail/pr14615.rkt @@ -0,0 +1,6 @@ +#lang typed/racket/base +(require racket/gui) +(define (f) + (let ([fn (put-file)]) + (when fn + (values fn))))