Make inst fail on results that are not single valued.
original commit: 62ff915a56694203bd22b91d7eb69dfeba5bbc51
This commit is contained in:
parent
d9c7180a00
commit
a42b7a0792
|
@ -42,23 +42,18 @@
|
|||
(define (do-inst tc-res inst)
|
||||
(define inst-type
|
||||
(if (row-syntax? inst) do-row-inst do-normal-inst))
|
||||
(define (error-case tys)
|
||||
(define (error-case number)
|
||||
(tc-error/expr
|
||||
"Cannot instantiate expression that produces ~a values"
|
||||
(if (null? tys) 0 "multiple")))
|
||||
number))
|
||||
(match tc-res
|
||||
[(tc-results: tys fs os)
|
||||
(match tys
|
||||
[(list ty)
|
||||
(ret (list (inst-type ty inst)) fs os)]
|
||||
[_
|
||||
(error-case tys)])]
|
||||
[(tc-results: tys fs os dty dbound)
|
||||
(match tys
|
||||
[(list ty)
|
||||
(ret (list (inst-type ty inst)) fs os dty dbound)]
|
||||
[_
|
||||
(error-case tys)])]))
|
||||
[_ (error-case (if (null? tys) 0 "multiple"))])]
|
||||
[_ (error-case "multiple")]))
|
||||
|
||||
|
||||
;; row-syntax? Syntax -> Boolean
|
||||
;; This checks if the syntax object resulted from a row instantiation
|
||||
|
|
|
@ -2969,6 +2969,15 @@
|
|||
(ret (-polydots (a ...)
|
||||
(->... (list) (a a) (-values (list
|
||||
(t:-> Univ (-values-dots (list) (t:-> Univ -Boolean : (-FS (-filter -Symbol (list 1 0)) -top)) 'a)))))))]
|
||||
|
||||
[tc-err
|
||||
(inst (eval '3) Any)
|
||||
#:ret (ret -Bottom)]
|
||||
[tc-err
|
||||
(lambda xs (inst (apply values (plambda: (b) ([x : b]) x) xs) Symbol))
|
||||
#:ret (ret (-polydots (a ...) (->... (list) (a a) (-values-dots (list (t:-> -Symbol -Symbol)) a 'a))))
|
||||
#:expected (ret (-polydots (a ...) (->... (list) (a a) (-values-dots (list (t:-> -Symbol -Symbol)) a 'a))))]
|
||||
|
||||
)
|
||||
(test-suite
|
||||
"tc-literal tests"
|
||||
|
|
Loading…
Reference in New Issue
Block a user