Fix internal error for untyped kw functions.
Closes PR12932. Closes PR12922.
This commit is contained in:
parent
fdd2966cf4
commit
9ef80edfef
8
collects/typed-racket/env/lexical-env.rkt
vendored
8
collects/typed-racket/env/lexical-env.rkt
vendored
|
@ -53,11 +53,17 @@
|
|||
[(syntax-procedure-converted-arguments-property i)
|
||||
=> (λ (prop)
|
||||
(define orig (car (flatten prop)))
|
||||
(define t (kw-convert (lookup-type/lexical orig env)))
|
||||
(define pre-t
|
||||
(lookup-type/lexical orig env
|
||||
#:fail (lambda (i) (lookup-fail i) #f)))
|
||||
(define t (if pre-t
|
||||
(kw-convert pre-t)
|
||||
Err))
|
||||
(register-type i t)
|
||||
t)]
|
||||
[else ((or fail lookup-fail) i)]))))))
|
||||
|
||||
|
||||
;; refine the type of i in the lexical env
|
||||
;; (identifier type -> type) identifier -> environment
|
||||
;; a macro for inlining :(
|
||||
|
|
|
@ -111,6 +111,6 @@
|
|||
[(arr: mand rng rest drest kws)
|
||||
(convert kws mand v rng rest drest split?)])))
|
||||
(make-Poly names (apply cl->* fns))]
|
||||
[_ (int-err 'kw-convert "non-function type" ft)]))
|
||||
[_ (int-err "kw-convert: non-function type ~a" ft)]))
|
||||
|
||||
(provide kw-convert)
|
||||
|
|
Loading…
Reference in New Issue
Block a user