Fix a bug in typechecking kw function application

Mandatory kw arguments in function types could confuse
the typechecker when the function had the
`syntax-procedure-converted-arguments-property` property
set.

original commit: a70588ac4fa27fc7c69b8901be8f129802db05d7
This commit is contained in:
Asumu Takikawa 2014-10-20 02:50:24 -04:00
parent 469f501a70
commit 5f0b741571
2 changed files with 29 additions and 5 deletions

View File

@ -28,12 +28,10 @@
(define ts
(flatten
(list
(for/list ([k (in-list mand-kw-t)])
(for/list ([k (in-list kw-t)])
(match k
[(Keyword: _ t _) t]))
(for/list ([k (in-list opt-kw-t)])
(match k
[(Keyword: _ t _) (list (-opt t) -Boolean)]))
[(Keyword: _ t #t) t]
[(Keyword: _ t #f) (list (-opt t) -Boolean)]))
plain-t
(for/list ([t (in-list opt-t)]) (-opt t))
(for/list ([t (in-list opt-t)]) -Boolean)

View File

@ -0,0 +1,26 @@
#lang racket/base
;; Tests for keyword ordering issues with mandatory keyword
;; arguments
(module a racket
(define (f a #:w [w "w"] #:x x #:y [y "y"]) x)
(provide f))
(module b typed-racket/base-env/extra-env-lang
(require (submod ".." a))
(type-environment
[f (->key -Symbol
;; this alphabetic ordering of keywords should
;; be preserved in the kw type conversion for applications,
;; rather than separating mandatory/optional as for lambdas
#:w -String #f
#:x -Symbol #t
#:y -String #f
-Symbol)]))
(module c typed/racket
(require (submod ".." b))
(f 'a #:x 'x))
(require 'c)