Here is a small example that shows the problem:
#lang typed/racket
(struct (A) foo
([x : A]))
(struct (A) bar foo ())
(struct (A) baz foo ())
(define (make-foo [i : Integer]) : (foo Integer)
(if (even? i)
(bar i)
(baz i)))
(define foos (map make-foo '(1 2 3 4 5 6)))
(list (baz? (car foos)) (if (baz? (car foos)) 1 2))
;;(#t 1) with #lang typed/racket/no-check
;;(#t 2) with #lang typed/racket
Note that if you remove the return type declaration (foo Integer) from
make-foo, it computes the correct result.
Thanks in advance for your help.
Best,
António.
--
You received this message because you are subscribed to the Google Groups
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-dev/CAJQmiZXgh_OK8s5mqUXdrshKneHz%2BuJ8QOifUnkz3K4LfTXS8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.