Check that at least one require spec is provided.
Closes PR 10617. Merge to v5.0.
This commit is contained in:
parent
a9250ec4f0
commit
27e971dce2
16
collects/tests/typed-scheme/fail/require-typed-missing.rkt
Normal file
16
collects/tests/typed-scheme/fail/require-typed-missing.rkt
Normal file
|
@ -0,0 +1,16 @@
|
|||
#;
|
||||
(exn-pred "at least one")
|
||||
#lang typed/racket
|
||||
|
||||
|
||||
(require/typed (make-main (([Listof Node] [Listof Edge] -> Graph)
|
||||
(State Number Number MouseEvent -> State)
|
||||
(State KeyEvent -> State)
|
||||
(State -> Scene)
|
||||
(Any -> Boolean)
|
||||
(State -> Boolean)
|
||||
(Stop -> Graph)
|
||||
(Any -> Edge)
|
||||
(Edge -> Graph)
|
||||
->
|
||||
(Boolean -> Graph))))
|
|
@ -79,7 +79,9 @@ This file defines two sorts of primitives. All of them are provided into any mod
|
|||
#:fail-unless (eq? 'opaque (syntax-e #'opaque)) #f
|
||||
#:with opt #'(#:name-exists)))
|
||||
(syntax-parse stx
|
||||
[(_ lib (~or sc:simple-clause strc:struct-clause oc:opaque-clause) ...)
|
||||
[(_ lib:expr (~or sc:simple-clause strc:struct-clause oc:opaque-clause) ...)
|
||||
(unless (< 0 (length (syntax->list #'(sc ... strc ... oc ...))))
|
||||
(raise-syntax-error #f "at least one specification is required" stx))
|
||||
#'(begin
|
||||
(require/opaque-type oc.ty oc.pred lib . oc.opt) ...
|
||||
(require/typed sc.nm sc.ty lib) ...
|
||||
|
|
Loading…
Reference in New Issue
Block a user