Add static contract tests for classes
original commit: 39b237043d0d91058ac8cb041eb665f502b17590
This commit is contained in:
parent
10f04eb58e
commit
07243dd154
|
@ -127,4 +127,20 @@
|
|||
(t-sc (-lst Univ) (listof/sc any-wrap/sc))
|
||||
(t-sc (Un (-lst Univ) -Number) (or/sc number/sc (listof/sc any-wrap/sc)))
|
||||
|
||||
;; classes
|
||||
(t-sc (-class) (class/sc null #f null null))
|
||||
(t-sc (-class #:init ([x -Number #f] [y -Number #f]))
|
||||
(class/sc (list (member-spec 'init 'x number/sc)
|
||||
(member-spec 'init 'y number/sc))
|
||||
#f null null))
|
||||
(t-sc (-class #:init ([x -Number #f] [y -Number #t]))
|
||||
(class/sc (list (member-spec 'init 'x number/sc)
|
||||
(member-spec 'init 'y number/sc))
|
||||
#f null null))
|
||||
(t-sc (-class #:init ([x -Number #f]) #:init-field ([y -Integer #f]))
|
||||
(class/sc (list (member-spec 'init 'x number/sc)
|
||||
(member-spec 'init 'y integer/sc)
|
||||
(member-spec 'field 'y integer/sc)
|
||||
(member-spec 'inherit-field 'y integer/sc))
|
||||
#f null null))
|
||||
))
|
||||
|
|
Loading…
Reference in New Issue
Block a user