diff --git a/collects/racket/contract/private/misc.rkt b/collects/racket/contract/private/misc.rkt index afc0d99309..442dcfcce1 100644 --- a/collects/racket/contract/private/misc.rkt +++ b/collects/racket/contract/private/misc.rkt @@ -814,7 +814,7 @@ #:projection list/c-chaperone/other-projection)) (define/subexpression-pos-prop (syntax/c ctc-in) - (let ([ctc (coerce-contract 'syntax/c ctc-in)]) + (let ([ctc (coerce-flat-contract 'syntax/c ctc-in)]) (flat-named-contract (build-compound-type-name 'syntax/c ctc) (let ([pred (flat-contract-predicate ctc)]) diff --git a/collects/tests/racket/contract-test.rktl b/collects/tests/racket/contract-test.rktl index 888efb1501..25b206fc04 100644 --- a/collects/tests/racket/contract-test.rktl +++ b/collects/tests/racket/contract-test.rktl @@ -9493,6 +9493,10 @@ 'pos 'neg)) + (test/no-error '(syntax/c (list/c #f))) + (contract-error-test 'syntax/c-non-flat '(syntax/c (vector/c #f)) + (λ (x) (regexp-match #rx"expected a flat contract" (exn-message x)))) + ; ;