diff --git a/collects/typed-racket/infer/infer-unit.rkt b/collects/typed-racket/infer/infer-unit.rkt index 0a94076d..a577b9b1 100644 --- a/collects/typed-racket/infer/infer-unit.rkt +++ b/collects/typed-racket/infer/infer-unit.rkt @@ -27,12 +27,12 @@ (define (seen-before s t) (cons (Type-seq s) (Type-seq t))) (define/cond-contract (remember s t A) - (Values/c Values/c + ((or/c AnyValues? Values/c) (or/c AnyValues? Values/c) (listof (cons/c exact-nonnegative-integer? exact-nonnegative-integer?)) . -> . (listof (cons/c exact-nonnegative-integer? exact-nonnegative-integer?))) (cons (seen-before s t) A)) (define/cond-contract (seen? s t) - (Values/c Values/c . -> . any/c) + ((or/c AnyValues? Values/c) (or/c AnyValues? Values/c) . -> . any/c) (member (seen-before s t) (current-seen))) @@ -587,7 +587,7 @@ ;; Y : (listof symbol?) - index variables that must have entries ;; R : Type/c - result type into which we will be substituting (define/cond-contract (subst-gen C Y R) - (cset? (listof symbol?) (or/c Values/c ValuesDots?) . -> . (or/c #f substitution/c)) + (cset? (listof symbol?) (or/c Values/c AnyValues? ValuesDots?) . -> . (or/c #f substitution/c)) (define var-hash (free-vars-hash (free-vars* R))) (define idx-hash (free-vars-hash (free-idxs* R))) ;; v : Symbol - variable for which to check variance @@ -721,7 +721,7 @@ (define/cond-contract (infer X Y S T R [expected #f]) (((listof symbol?) (listof symbol?) (listof Type/c) (listof Type/c) (or/c #f Values/c ValuesDots?)) - ((or/c #f Values/c ValuesDots?)) + ((or/c #f Values/c AnyValues? ValuesDots?)) . ->* . (or/c boolean? substitution/c)) (with-handlers ([exn:infer? (lambda _ #f)]) (let* ([expected-cset (if expected diff --git a/collects/typed-racket/infer/signatures.rkt b/collects/typed-racket/infer/signatures.rkt index 7fc10ae5..fbea98be 100644 --- a/collects/typed-racket/infer/signatures.rkt +++ b/collects/typed-racket/infer/signatures.rkt @@ -41,7 +41,7 @@ ;; range (or/c #f Values/c ValuesDots?)) ;; optional expected type - ((or/c #f Values/c ValuesDots?)) + ((or/c #f Values/c AnyValues? ValuesDots?)) . ->* . any)] [cond-contracted infer/vararg ((;; variables from the forall (listof symbol?) @@ -56,7 +56,7 @@ ;; range (or/c #f Values/c ValuesDots?)) ;; [optional] expected type - ((or/c #f Values/c ValuesDots?)) . ->* . any)] + ((or/c #f Values/c AnyValues? ValuesDots?)) . ->* . any)] [cond-contracted infer/dots (((listof symbol?) symbol? (listof Values/c) @@ -64,4 +64,4 @@ Values/c (or/c Values/c ValuesDots?) (listof symbol?)) - (#:expected (or/c #f Values/c ValuesDots?)) . ->* . any)])) + (#:expected (or/c #f Values/c AnyValues? ValuesDots?)) . ->* . any)])) diff --git a/collects/typed-racket/typecheck/tc-app-helper.rkt b/collects/typed-racket/typecheck/tc-app-helper.rkt index 83295c74..fd1db072 100644 --- a/collects/typed-racket/typecheck/tc-app-helper.rkt +++ b/collects/typed-racket/typecheck/tc-app-helper.rkt @@ -92,7 +92,7 @@ ((syntax? syntax? Type/c (c:listof (c:listof Type/c)) (c:listof (c:or/c #f Type/c)) (c:listof (c:or/c #f (c:cons/c Type/c (c:or/c c:natural-number/c symbol?)))) (c:listof SomeValues/c) (c:listof tc-results?) (c:or/c #f Type/c) c:any/c) - (#:expected (c:or/c #f tc-results?) #:return tc-results? + (#:expected (c:or/c #f tc-results/c) #:return tc-results? #:msg-thunk (c:-> string? string?)) . c:->* . tc-results/c) diff --git a/collects/typed-racket/typecheck/tc-funapp.rkt b/collects/typed-racket/typecheck/tc-funapp.rkt index 2481f811..3d94c837 100644 --- a/collects/typed-racket/typecheck/tc-funapp.rkt +++ b/collects/typed-racket/typecheck/tc-funapp.rkt @@ -67,7 +67,7 @@ ;; if nothing matched, error (domain-mismatches f-stx args-stx t doms rests drests rngs argtys #f #f - #:expected expected #:return (or expected (ret (Un))) + #:expected expected #:return (if (tc-results? expected) expected (ret (Un))) #:msg-thunk (lambda (dom) (string-append "No function domains matched in function application:\n"