
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.
11 lines
216 B
Racket
11 lines
216 B
Racket
#lang racket
|
|
|
|
;; Wrapping opaque structs should succeed
|
|
|
|
;; From Issue #203
|
|
;; https://github.com/racket/typed-racket/issues/203
|
|
|
|
(require typed-racket/utils/any-wrap)
|
|
(struct s ())
|
|
(contract any-wrap/c (s) 'a 'b)
|