Can we make this error message a little more informative? People find this confusing.
Sam On Jun 26, 2014 2:22 AM, <as...@racket-lang.org> wrote: > asumu has updated `master' from 5339cbaac9 to 9a14c9c420. > http://git.racket-lang.org/plt/5339cbaac9..9a14c9c420 > > =====[ One Commit ]===================================================== > Directory summary: > 44.4% pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/ > 55.5% > pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/ > > ~~~~~~~~~~ > > 9a14c9c Asumu Takikawa <as...@racket-lang.org> 2014-06-26 01:35 > : > | Fix error for application Procedure type values > | > | Removal of top-arr in the internal representation changed > | the error message and we didn't have a test for it. > | > | Closes PR 14601 > : > M .../tests/typed-racket/unit-tests/typecheck-tests.rkt | 7 > +++++++ > M .../typed-racket/typecheck/tc-app-helper.rkt | 3 ++- > > =====[ Overall Diff ]=================================================== > > > pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-app-helper.rkt > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > --- > OLD/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-app-helper.rkt > +++ > NEW/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 > > > pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > --- > OLD/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt > +++ > NEW/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 >
_________________________ Racket Developers list: http://lists.racket-lang.org/dev