|
272 | 272 | #:return-when (memq dbound* Y) #f
|
273 | 273 | (let* ([arg-mapping (cgen/list V X Y ts ss)]
|
274 | 274 | ;; just add dbound as something that can be constrained
|
275 |
| - [darg-mapping (% move-dotted-rest-to-dmap (cgen V (cons dbound X) Y t-dty s-dty) dbound dbound*)] |
| 275 | + [darg-mapping |
| 276 | + (extend-tvars (list dbound*) |
| 277 | + (% move-dotted-rest-to-dmap (cgen V (cons dbound X) Y t-dty s-dty) dbound dbound*))] |
276 | 278 | [ret-mapping (cg s t)])
|
277 | 279 | (% cset-meet arg-mapping darg-mapping ret-mapping))]
|
278 | 280 | [((arr: ss s #f (cons s-dty dbound) '())
|
279 | 281 | (arr: ts t #f (cons t-dty (? (λ (db) (memq db Y)) dbound*)) '()))
|
280 | 282 | #:return-unless (= (length ss) (length ts)) #f
|
281 | 283 | (let* ([arg-mapping (cgen/list V X Y ts ss)]
|
282 | 284 | ;; just add dbound as something that can be constrained
|
283 |
| - [darg-mapping (% move-dotted-rest-to-dmap (cgen V (cons dbound* X) Y t-dty s-dty) dbound* dbound)] |
| 285 | + [darg-mapping |
| 286 | + (extend-tvars (list dbound) |
| 287 | + (% move-dotted-rest-to-dmap (cgen V (cons dbound* X) Y t-dty s-dty) dbound* dbound))] |
284 | 288 | [ret-mapping (cg s t)])
|
285 | 289 | (% cset-meet arg-mapping darg-mapping ret-mapping))]
|
286 | 290 | ;; * <: ...
|
|
438 | 442 | #:return-when (memq t-dbound Y) #f
|
439 | 443 | (% cset-meet
|
440 | 444 | (cgen/list V X Y ss ts)
|
441 |
| - (% move-dotted-rest-to-dmap (cgen V (cons s-dbound X) Y s-dty t-dty) s-dbound t-dbound))] |
| 445 | + (extend-tvars (list t-dbound) |
| 446 | + (% move-dotted-rest-to-dmap (cgen V (cons s-dbound X) Y s-dty t-dty) s-dbound t-dbound)))] |
442 | 447 | [((ValuesDots: ss s-dty s-dbound)
|
443 | 448 | (ValuesDots: ts t-dty (? (λ (db) (memq db Y)) t-dbound)))
|
444 | 449 | ;; s-dbound can't be in Y, due to previous rule
|
445 | 450 | (% cset-meet
|
446 | 451 | (cgen/list V X Y ss ts)
|
447 |
| - (% move-dotted-rest-to-dmap (cgen V (cons t-dbound X) Y s-dty t-dty) t-dbound s-dbound))] |
| 452 | + (extend-tvars (list s-dbound) |
| 453 | + (% move-dotted-rest-to-dmap (cgen V (cons t-dbound X) Y s-dty t-dty) t-dbound s-dbound)))] |
448 | 454 |
|
449 | 455 | ;; they're subtypes. easy.
|
450 | 456 | [(a b)
|
|
585 | 591 | [((ListDots: s-dty (? (λ (db) (memq db Y)) s-dbound)) (ListDots: t-dty t-dbound))
|
586 | 592 | ;; What should we do if both are in Y?
|
587 | 593 | #:return-when (memq t-dbound Y) #f
|
588 |
| - (% move-dotted-rest-to-dmap (cgen V (cons s-dbound X) Y s-dty t-dty) s-dbound t-dbound)] |
| 594 | + (extend-tvars (list t-dbound) |
| 595 | + (% move-dotted-rest-to-dmap (cgen V (cons s-dbound X) Y s-dty t-dty) s-dbound t-dbound))] |
589 | 596 | [((ListDots: s-dty s-dbound) (ListDots: t-dty (? (λ (db) (memq db Y)) t-dbound)))
|
590 | 597 | ;; s-dbound can't be in Y, due to previous rule
|
591 |
| - (% move-dotted-rest-to-dmap (cgen V (cons t-dbound X) Y s-dty t-dty) t-dbound s-dbound)] |
| 598 | + (extend-tvars (list s-dbound) |
| 599 | + (% move-dotted-rest-to-dmap (cgen V (cons t-dbound X) Y s-dty t-dty) t-dbound s-dbound))] |
592 | 600 |
|
593 | 601 | ;; this constrains `dbound' to be |ts| - |ss|
|
594 | 602 | [((ListDots: s-dty dbound) (List: ts))
|
|
0 commit comments