
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.
20 lines
465 B
Racket
20 lines
465 B
Racket
#;
|
|
(exn-pred #rx"u: contract violation\n expected: Integer")
|
|
#lang racket
|
|
|
|
(module typed typed/racket
|
|
(provide (all-defined-out))
|
|
(define-signature x^ ([x : Integer]))
|
|
(define-signature y^ ([y : (-> Integer Integer)]))
|
|
|
|
(define u
|
|
(unit (import x^) (export y^) (define (y n) x))))
|
|
|
|
(module untyped racket
|
|
(require (submod ".." typed))
|
|
(define x 11)
|
|
(define-values/invoke-unit u (import x^) (export y^))
|
|
(y "not an integer"))
|
|
|
|
(require 'untyped)
|