Add test for match improvements.

Improve handling of inference for let loop.  

svn: r14573

original commit: b1b5fe481681aef76c06b8abf1abe4cc267533ec
This commit is contained in:
Sam Tobin-Hochstadt 2009-04-21 15:35:05 +00:00
parent 17c0dbbcd3
commit a6b5a432c0
3 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,6 @@
#lang typed-scheme
(: f ((Listof Number) -> (Listof Number)))
(define (f x)
(for/lists (#{y : (Listof Number)}) ([e (in-list x)])
e))

View File

@ -0,0 +1,9 @@
#lang typed-scheme
(require scheme/match)
(match "abc"
[(regexp "^abc") 1])
(match (list 1 1)
[(list x x) 1])

View File

@ -811,7 +811,12 @@
(ret expected))]
;; special case when argument needs inference
[_
(let ([ts (map (compose generalize tc-expr/t) (syntax->list actuals))])
(let ([ts (for/list ([ac (syntax->list actuals)]
[f (syntax->list args)])
(or
(type-annotation f #:infer #t)
(generalize (tc-expr/t ac))))])
(printf "case 2 ~a~n" ts)
(tc/rec-lambda/check form args body lp ts expected)
(ret expected))]))