Fix up singleton values
This commit is contained in:
parent
044bd551b0
commit
d0939ffa1e
|
@ -464,7 +464,7 @@
|
|||
;; and T-dotted is the repeated type
|
||||
(define (infer/dots X dotted-var S T T-dotted R must-vars [expected #f])
|
||||
(with-handlers ([exn:infer? (lambda _ #f)])
|
||||
(let* ([short-S (debug (take S (length T)))]
|
||||
(let* ([short-S (take S (length T))]
|
||||
[rest-S (drop S (length T))]
|
||||
[cs-short (cgen/list null (cons dotted-var X) short-S T)]
|
||||
[new-vars (for/list ([i (in-range (length rest-S))]) (gensym dotted-var))]
|
||||
|
@ -484,4 +484,4 @@
|
|||
(define (i s t r)
|
||||
(infer/simple (list s) (list t) r))
|
||||
|
||||
(trace cgen/arr cgen cgen/list)
|
||||
;;(trace cgen/arr cgen cgen/list)
|
|
@ -56,6 +56,12 @@
|
|||
(make-ValuesDots (map sb types) (sb dty) dbound))])
|
||||
target))
|
||||
|
||||
;; the other definition is not accessible here
|
||||
(define (-values args)
|
||||
(if (= (length args) 1)
|
||||
(car args)
|
||||
(make-Values args)))
|
||||
|
||||
;; substitute-dots : Listof[Type] Option[type] Name Type -> Type
|
||||
(define (substitute-dots images rimage name target)
|
||||
(define (sb t) (substitute-dots images rimage name t))
|
||||
|
@ -63,7 +69,7 @@
|
|||
(type-case sb target
|
||||
[#:ValuesDots types dty dbound
|
||||
(if (eq? name dbound)
|
||||
(make-Values
|
||||
(-values
|
||||
(append
|
||||
(map sb types)
|
||||
;; We need to recur first, just to expand out any dotted usages of this.
|
||||
|
|
Loading…
Reference in New Issue
Block a user