Test for appropriate predicates for invariant structs.
original commit: cab90c16d5514ac4c9dff70ebcaeb3dda75e0910
This commit is contained in:
parent
bb2afd9169
commit
43863acd36
14
collects/tests/typed-racket/succeed/structs-variance.rkt
Normal file
14
collects/tests/typed-racket/succeed/structs-variance.rkt
Normal file
|
@ -0,0 +1,14 @@
|
|||
#lang typed/racket
|
||||
|
||||
(struct: (A) x ([f : (A -> A)]))
|
||||
(struct: (B) y ([f : (x B)]))
|
||||
|
||||
(: f : (U Integer (y Integer)) -> Integer)
|
||||
(define (f v)
|
||||
(if (y? v)
|
||||
((x-f (y-f v)) 0)
|
||||
v))
|
||||
|
||||
(f 17)
|
||||
|
||||
(f (y (x (lambda: ([n : Integer]) (+ 2 n)))))
|
Loading…
Reference in New Issue
Block a user