diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-send.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-send.rkt index f0b5beab..2232a0dd 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-send.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-send.rkt @@ -28,7 +28,7 @@ retval)] [(tc-result1: t) (int-err "non-symbol methods not supported by Typed Racket: ~a" t)])] [(tc-result1: t) (tc-error/expr/fields - #:return (or expected (ret -Bottom)) + #:return (ret -Bottom) "send: type mismatch" "expected" "an object" "given" t)])) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/class-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/class-tests.rkt index a1d5710b..7f0fc351 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/class-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/class-tests.rkt @@ -104,6 +104,10 @@ (define/public (m x) (n)))) (void)) -Void] + ;; Send to non object + [tc-err (send 4 m 3) + #:ret (ret (-val 5)) + #:expected (ret (-val 5) -no-filter -no-obj)] ;; Field access via get-field [tc-e (let () (: j% (Class (field [n Integer])