
Guard opaque predicates with an (-> Any Any) contract. This uses the contract generation infrastructure to avoid wrapping struct predicates. Also, relax `any-wrap/c` (the contract used for `Any` in positive position) to allow opaque structures. This also requires an enumeration of all the other kinds of values that TR understands, so that they are not confused with opaque structures. Joint work with @bennn. Closes #202. Closes #203. Closes #241.
16 lines
176 B
Racket
16 lines
176 B
Racket
#lang racket/load
|
|
|
|
(module m typed/racket
|
|
(struct: s ())
|
|
|
|
(struct: s2 s ())
|
|
(define: v : Any (s2))
|
|
(provide v))
|
|
|
|
(module n racket
|
|
(require 'm)
|
|
v)
|
|
|
|
(require 'n)
|
|
|