Fix for-each type.
Improve ... error messages.
This commit is contained in:
parent
c4e253d2d1
commit
2ad4403108
|
@ -123,7 +123,7 @@
|
|||
[procedure? (make-pred-ty (make-Function (list (make-top-arr))))]
|
||||
[map (-polydots (c a b) ((list ((list a) (b b) . ->... . c) (-lst a))
|
||||
((-lst b) b) . ->... .(-lst c)))]
|
||||
[for-each (-polydots (c a b) ((list ((list a) (b b) . ->... . -Void) (-lst a))
|
||||
[for-each (-polydots (c a b) ((list ((list a) (b b) . ->... . Univ) (-lst a))
|
||||
((-lst b) b) . ->... . -Void))]
|
||||
[fold-left (-polydots (c a b) ((list ((list c a) (b b) . ->... . c) c (-lst a))
|
||||
((-lst b) b) . ->... . c))]
|
||||
|
|
|
@ -310,8 +310,8 @@
|
|||
"no polymorphic function domain matched - domain was: ~a rest type was: ~a arguments were ~a"
|
||||
(stringify dom) rest (stringify argtypes))]))]
|
||||
;; polymorphic ... type
|
||||
[(tc-result: (PolyDots: (and vars (list fixed-vars ... dotted-var))
|
||||
(Function: (list (arr: dom rng #f (cons dty dbound) thn-eff els-eff)))))
|
||||
[(tc-result: (and t (PolyDots: (and vars (list fixed-vars ... dotted-var))
|
||||
(Function: (list (arr: dom rng #f (cons dty dbound) thn-eff els-eff))))))
|
||||
(for-each (lambda (x) (unless (not (Poly? x))
|
||||
(tc-error "Polymorphic argument ~a to polymorphic function not allowed" x)))
|
||||
argtypes)
|
||||
|
@ -325,9 +325,15 @@
|
|||
[(and expected substitution) expected]
|
||||
[substitution
|
||||
(ret (subst-all substitution rng))]
|
||||
[else (tc-error/expr #:return (ret (Un))
|
||||
"no polymorphic function domain matched -~ndomain was: ~a ~ndotted rest type was: ~a ... ~a~narguments were ~a"
|
||||
(stringify dom) dty dbound (stringify argtypes))]))]
|
||||
[else
|
||||
(match t
|
||||
[(PolyDots-names: vars
|
||||
(Function: (list (arr: dom rng #f (cons dty dbound) thn-eff els-eff))))
|
||||
(tc-error/expr #:return (ret (Un))
|
||||
(string-append
|
||||
"no polymorphic function domain matched -~n"
|
||||
"domain was: ~a ~ndotted rest type was: ~a ... ~a~narguments were ~a")
|
||||
(stringify dom) dty dbound (stringify argtypes))])]))]
|
||||
[(tc-result: (Poly: vars (Function: (list (arr: doms rngs rests #f thn-effs els-effs) ...))))
|
||||
(tc-error/expr #:return (ret (Un)) "polymorphic vararg case-lambda application not yet supported")]
|
||||
[(tc-result: (Poly: vars (Function: (list (arr: doms rngs #f drests thn-effs els-effs) ...))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user