-
-
Couldn't load subscription status.
- Fork 104
Open
Description
What version of Racket are you using?
8.18 [cs]
What program did you run?
#lang typed/racket
(module m typed/racket/shallow
(module n racket
(provide (all-defined-out))
(struct v () #:property prop:sequence (λ (v) '()))
(define (make-v) (v))
(define (v?? v)
(cond
[(v? v) (displayln "yes") #t]
[else (displayln "no") #f])))
(require/typed 'n
[make-v (∀ (a) (→ (Sequenceof a)))]
[v?? (→ Any Boolean)])
(provide (all-defined-out))
(define v? v??)
(define v (inst make-v Nothing)))
(require 'm)
(v? (v))What should have happened?
The value created by (v) is an instance of the v struct, so the predicate v? should identify it. If the top-level language is changed from #lang typed/racket to #lang typed/racket/shallow, the program behaves as expected:
yes
#t
If you got an error message, please include it here.
The actual output is:
no
#f
Metadata
Metadata
Assignees
Labels
No labels