Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type-checking list elements #1382

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions typed-racket-lib/typed-racket/typecheck/tc-app/tc-app-list.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,8 @@
(add-typeof-expr #'op-name (ret (->* arg-tys return-ty :T+ #t)))
(ret return-ty)))
(or result
;; When arguments to the list function fail to typecheck, the
;; odds are those argument expressions are ill-typed. In that
;; case, we should only report those type errors instead of the error
;; that the result type of application of list doesn't match
;; the expected one.
(let-values ([(tys errs) (for/lists (tys errs)
([i (in-list args-list)])
(tc-expr/t* i))])
(when (andmap not errs)
(expected-but-got t (-Tuple tys)))
(fix-results expected)))]
(begin (expected-but-got t (-Tuple (map tc-expr/t args-list)))
(fix-results expected)))]
[else
(define arg-tys (map tc-expr/t args-list))
(define return-ty (-Tuple arg-tys))
Expand Down