Fix rest arg contract generation for case-> types

The generated contracts are still not ideal when more than
one case has a rest argument, since a later case in the
case-> contract may pass but case-> won't try all of them.
This commit is contained in:
Asumu Takikawa 2014-05-16 14:59:43 -04:00
parent 02d046daf1
commit fce98517e6
2 changed files with 6 additions and 1 deletions

View File

@ -515,7 +515,7 @@
" with optional keyword arguments")))
(if case->
(arr/sc (process-dom (map t->sc/neg dom))
(and rst (t->sc/neg rst))
(and rst (listof/sc (t->sc/neg rst)))
(map t->sc rngs))
(function/sc
(process-dom (map t->sc/neg dom))

View File

@ -213,4 +213,9 @@
(λ (x) 1)
#:untyped
#:msg #rx"produced: 1.*blaming: untyped")
(t-int (cl->* (->* '() -String -String)
(->* (list -Symbol) -Symbol -Symbol))
(λ (f) (f "a" "b"))
(case-lambda [xs (car xs)]
[(sym . xs) sym]))
))