typed-racket
typed-racket copied to clipboard
When using `define-predicate` for the recursive Pair type, the error message is incorrect.
What version of Racket are you using?
v8.3
What program did you run?
> (define-type T (Pair T T))
> (define-predicate t? T)
; g5: unbound identifier;
; also, no #%top syntax transformer is bound
; in: g5
; [,bt for context]
What should have happened?
> (define-type T (Pair T T))
> (define-predicate t? T)
; readline-input:2:21: Type Checker: Error in macro expansion -- Type T could
; not be converted to a predicate: required a flat contract but generated a
; chaperone contract
; in: T
; [,bt for context]