Fix broken match clause for accessors.

original commit: 314584d05ecd64d87038b64b6f2f88abea1e3910
This commit is contained in:
Eric Dobson 2014-05-31 15:33:55 -07:00
parent a5b0975a39
commit c1c7f04f3c
2 changed files with 37 additions and 3 deletions

View File

@ -71,9 +71,9 @@
(Empty:))))
#f #f '())))
`(make-pred-ty (list ,@(map sub dom)) ,(sub t) ,(sub ft) ,(sub n) ,(sub pth))]
[(Function: (list (arr: dom (Values: (list (Result: t (FilterSet: (NotTypeFilter: (== -False) pth 0)
(TypeFilter: (== -False) pth 0))
(Path: pth 0))))
[(Function: (list (arr: dom (Values: (list (Result: t (FilterSet: (NotTypeFilter: (== -False) pth (list 0 0))
(TypeFilter: (== -False) pth (list 0 0)))
(Path: pth (list 0 0)))))
#f #f '())))
`(->acc (list ,@(map sub dom)) ,(sub t) ,(sub pth))]
[(Union: elems) (split-union elems)]

View File

@ -0,0 +1,34 @@
#lang racket/base
(require "test-utils.rkt"
rackunit
mzlib/pconvert
(env init-envs)
(types abbrev union))
(provide tests)
(gen-test-main)
(define (convert v)
(parameterize ((current-print-convert-hook converter)
;; ignore sharing in all cases
(current-build-share-hook (λ (v basic sub) 'atomic))
(show-sharing #f)
(booleans-as-true/false #f))
(syntax->datum (datum->syntax #f (print-convert v)))))
(define tests
(test-suite "Init Env"
(test-suite "Convert"
(check-equal?
(convert (-> -String -Symbol))
'(simple-> (list -String) -Symbol))
(check-equal?
(convert (make-pred-ty -String))
'(make-pred-ty (list Univ) -Boolean -String `(0 0) `()))
(check-equal?
(convert (->acc (list (-lst -String)) -String (list -car)))
'(->acc (list (-lst -String)) -String `(,-car)))
)
))