From 6f7c938c0bf74847cbbab8df761ab9296819181d Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 7 Apr 2013 19:38:12 -0500 Subject: [PATCH] fix ->m for keyword arguments closes PR 13674 --- collects/racket/contract/private/arrow.rkt | 4 ++-- collects/tests/racket/contract-test.rktl | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/collects/racket/contract/private/arrow.rkt b/collects/racket/contract/private/arrow.rkt index 2db2edb945..a07130a07e 100644 --- a/collects/racket/contract/private/arrow.rkt +++ b/collects/racket/contract/private/arrow.rkt @@ -293,8 +293,8 @@ v4 todo: (tx s)))]) (with-syntax ([kwd-lam-params (if dom-rest - #'(dom-x ... [opt-dom-x unspecified-dom] ... kwd-param ... . rest-x) - #'(dom-x ... [opt-dom-x unspecified-dom] ... kwd-param ...))] + #'(this-param ... dom-x ... [opt-dom-x unspecified-dom] ... kwd-param ... . rest-x) + #'(this-param ... dom-x ... [opt-dom-x unspecified-dom] ... kwd-param ...))] [basic-return (let ([inner-stx-gen (if need-apply-values? diff --git a/collects/tests/racket/contract-test.rktl b/collects/tests/racket/contract-test.rktl index 25d8af4368..bcf17e0674 100644 --- a/collects/tests/racket/contract-test.rktl +++ b/collects/tests/racket/contract-test.rktl @@ -8567,6 +8567,20 @@ (class object% (super-new) (define/public (m x) x)) 'pos 'neg)) + + (test/spec-passed + '->m-kwd-first-order-1 + '(contract (class/c [m (->m #:x number? number?)]) + (class object% (super-new) (define/public (m #:x x) x)) + 'pos + 'neg)) + + (test/pos-blame + '->m-kwd-first-order-2 + '(contract (class/c [m (->m #:y number? number?)]) + (class object% (super-new) (define/public (m #:x x) x)) + 'pos + 'neg)) (test/spec-passed '->*m-first-order-1