Add test for match improvements.
Improve handling of inference for let loop. svn: r14573 original commit: b1b5fe481681aef76c06b8abf1abe4cc267533ec
This commit is contained in:
parent
17c0dbbcd3
commit
a6b5a432c0
6
collects/tests/typed-scheme/succeed/for-lists.ss
Normal file
6
collects/tests/typed-scheme/succeed/for-lists.ss
Normal 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))
|
9
collects/tests/typed-scheme/succeed/match-tests.ss
Normal file
9
collects/tests/typed-scheme/succeed/match-tests.ss
Normal file
|
@ -0,0 +1,9 @@
|
|||
#lang typed-scheme
|
||||
|
||||
(require scheme/match)
|
||||
|
||||
(match "abc"
|
||||
[(regexp "^abc") 1])
|
||||
|
||||
(match (list 1 1)
|
||||
[(list x x) 1])
|
|
@ -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))]))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user