这是indexloc提供的服务,不要输入任何密码
Skip to content

avoid calling normalize-type outside of shallow tr #1296

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

Merged
merged 1 commit into from
Dec 13, 2022
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
7 changes: 5 additions & 2 deletions typed-racket-lib/typed-racket/utils/shallow-utils.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@
(submod typed-racket/rep/type-rep shallow-exports)
typed-racket/types/tc-result
typed-racket/types/type-table
typed-racket/types/union)
typed-racket/types/union
typed-racket/utils/tc-utils)


(define (ArrowT+? arr)
(and (Arrow? arr) (Arrow-rng-shallow-safe? arr)))

(define (shallow-trusted-positive? orig-ty)
(let loop ((ty (normalize-type orig-ty)))
(define in-shallow? (eq? shallow (current-type-enforcement-mode)))
;; 2022-12-12: normalize only in shallow mode to save time
(let loop ((ty ((if in-shallow? normalize-type values) orig-ty)))
(match ty
[(Fun: arr*)
(andmap ArrowT+? arr*)]
Expand Down