typed-racket
typed-racket copied to clipboard
recursive types + intersections
What version of Racket are you using?
0f733e29fe4a0737c1e662c1fb2bae9d350b4fbb or later
What program did you run?
#lang typed/racket/base
(define-type Type (U String (And Type)))
(struct (X) And ([ts : (Listof (∩ Type X))]))
With output Type Checker: Error in macro expansion -- structure type constructor applied to non-regular arguments type: And arguments...: (Type)
What should have happened?
This should work -- and does work if you replace (∩ Type X)
with either Type
or X
.
I want to look into this more but don't want to get sidetracked at the moment... so here's an issue! =)