Fix broken case in case-lambda.
This commit is contained in:
parent
fdbe0d3f27
commit
2613994ca7
|
@ -317,7 +317,7 @@
|
|||
[(Function: (and fs (list (arr: argss rets rests drests '()) ...)))
|
||||
(for/list ([a (in-list argss)] [f (in-list fs)] [r (in-list rests)] [dr (in-list drests)]
|
||||
#:when (if (formals-rest fml)
|
||||
(>= (length a) (length (formals-positional fml)))
|
||||
(or r (>= (length a) (length (formals-positional fml))))
|
||||
((if (or r dr) <= =) (length a) (length (formals-positional fml)))))
|
||||
f)]
|
||||
[_ null]))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#;
|
||||
(exn-pred 1)
|
||||
(exn-pred 2)
|
||||
#lang typed/racket
|
||||
(: f (case->
|
||||
(Symbol Symbol * -> Integer)
|
||||
|
|
|
@ -2747,6 +2747,18 @@
|
|||
(f 1 2 3))
|
||||
#:ret (ret Univ -true-filter)]
|
||||
|
||||
[tc-err
|
||||
(case-lambda
|
||||
((x y . z) 'x)
|
||||
((x . y) 'x)
|
||||
(w (first w)))
|
||||
#:ret
|
||||
(ret (cl->* (->* (list -Symbol -Symbol) -Symbol -Symbol)
|
||||
(->* (list) -String -String)))
|
||||
#:expected
|
||||
(ret (cl->* (->* (list -Symbol -Symbol) -Symbol -Symbol)
|
||||
(->* (list) -String -String)))]
|
||||
|
||||
;; typecheck-fail should fail
|
||||
[tc-err (typecheck-fail #'stx "typecheck-fail")
|
||||
#:msg #rx"typecheck-fail"]
|
||||
|
|
Loading…
Reference in New Issue
Block a user