typed-racket icon indicating copy to clipboard operation
typed-racket copied to clipboard

When using `define-predicate` for the recursive Pair type, the error message is incorrect.

Open NoahStoryM opened this issue 3 years ago • 0 comments

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]

NoahStoryM avatar Nov 08 '21 11:11 NoahStoryM