typed-racket/typed-racket-test/succeed/define-values-invoke-unit-subtyping.rkt
Daniel Feltey 2e0cc095c7 Initial support for typed units in typed racket.
Most unit forms are supported, including most of the "infer" forms that
infer imports/exports/linkages from the current context.

Notably, none of the structural linking forms for units are supported, and
`define-unit-binding` is also currently unsupported.
2015-09-10 16:32:11 -05:00

11 lines
338 B
Racket

#lang typed/racket
(define-signature a1^ ([a1 : Integer]))
(define-signature a2^ extends a1^ ([a2 : Integer]))
(define-signature b^ ([b : Integer]))
(define-unit u1 (import) (export a2^) (define a1 6) (define a2 7))
(define-unit u2 (import a1^) (export b^) (define b (+ a1 11)))
(define-values/invoke-unit/infer (export) (link u1 u2))