Add missing contract generation error cases

Functions with dotted values or AnyValues in the return type
aren't yet supported for contract generation.

Related to PR 14894
This commit is contained in:
Asumu Takikawa 2014-12-27 04:52:53 -05:00
parent 9fe834d35c
commit 643c20afdb
2 changed files with 13 additions and 1 deletions

View File

@ -586,7 +586,13 @@
(if (from-untyped? typed-side)
(fail #:reason (~a "cannot generate contract for function type"
" with filters or objects."))
(convert-arr a))]))
(convert-arr a))]
[(arr: dom (? ValuesDots?) rst drst kws)
(fail #:reason (~a "cannot generate contract for function type"
" with dotted return values"))]
[(arr: dom (? AnyValues?) rst drst kws)
(fail #:reason (~a "cannot generate contract for function type"
" with unknown return values"))]))
(define arities
(for/list ([t arrs])
(match t

View File

@ -160,6 +160,12 @@
(t/fail (-> (-polydots (a) (->... (list) (a a) -Symbol)) Univ)
"cannot generate contract for variable arity polymorphic type")
;; PR 14894 - FIXME: the polydots case may be possible for typed functions
(t/fail (-polydots (a) (->... (list) (a a) (make-ValuesDots null a 'a)))
"dotted return values")
(t/fail (-> ManyUniv)
"unknown return values")
(t/fail
(make-Function
(list (make-arr* (list) -Boolean #:kws (list (make-Keyword '#:key Univ #f)))