
* Add `instantiate/optimize` to the static contracts API (new function in `instantiate.rkt`) * Add optional kwd arg `#:recursive-kinds` to sc optimizer * SC optimizer uses recursive kinds to tell if a `name/sc` or `recursive-sc` will generate a flat contract * `instantiate/optimize` - solves for a recursive kinds table - calls `optimize` with the table - calls `instantiate` with the same table
23 lines
358 B
Racket
23 lines
358 B
Racket
#lang racket/base
|
|
|
|
;; Test that the `Spec` type can be converted to a contract that
|
|
;; successfully **runs**
|
|
|
|
(module t typed/racket/base
|
|
(provide f g)
|
|
|
|
(define-type Spec
|
|
(-> (U Spec String)))
|
|
|
|
(: f (-> Spec))
|
|
(define (f)
|
|
(λ () "hello"))
|
|
|
|
(: g (-> (Rec T (-> (U T String)))))
|
|
(define (g)
|
|
(λ () "hello")))
|
|
|
|
(require 't)
|
|
|
|
(void f g)
|