(require/typed/check m rt-clause ...)
If you cannot know ahead of time whether m is typed or untyped but want to avoid Typed-Racket-generated contracts if m happens to be typed, this macro is worth using. Otherwise, just use require or require/typed.
All submodules of the current module are assumed untyped. The current implementation would need to compile the module’s submodules to be sure; it breaks the circular dependency by assuming the worst.
Any #:opaque imports are required via require/typed. (Previously, they weren’t imported at all —
now they’re imported under contract.)
> (module t typed/racket (require require-typed-check) (require/typed/check math (divides? (-> Integer Integer Boolean))) (require/typed/check racket/contract (has-contract? (-> Any Boolean))) (define (check-contract id) (printf "~a does~a have a contract~n" (object-name id) (if (has-contract? id) "" " not"))) (check-contract divides?) (check-contract has-contract?)) > (require 't)
divides? does not have a contract
has-contract? does have a contract