Handle multiple instantiation of a single expression.
svn: r12148
This commit is contained in:
parent
d60ae208e1
commit
0c44c5ce40
|
@ -52,6 +52,14 @@
|
|||
(define (split-last l)
|
||||
(let-values ([(all-but last-list) (split-at l (sub1 (length l)))])
|
||||
(values all-but (car last-list))))
|
||||
(define (in-improper-stx stx)
|
||||
(let loop ([l stx])
|
||||
(match l
|
||||
[#f null]
|
||||
[(cons a b) (cons a (loop b))]
|
||||
[e (list e)])))
|
||||
(for/fold ([ty ty])
|
||||
([inst (in-improper-stx inst)])
|
||||
(cond [(not inst) ty]
|
||||
[(not (or (Poly? ty) (PolyDots? ty)))
|
||||
(tc-error/expr #:return (Un) "Cannot instantiate non-polymorphic type ~a" ty)]
|
||||
|
@ -87,7 +95,7 @@
|
|||
[_
|
||||
(instantiate-poly ty (map parse-type (syntax->list inst)))]))]
|
||||
[else
|
||||
(instantiate-poly ty (map parse-type (syntax->list inst)))]))
|
||||
(instantiate-poly ty (map parse-type (syntax->list inst)))])))
|
||||
|
||||
;; typecheck an identifier
|
||||
;; the identifier has variable effect
|
||||
|
|
Loading…
Reference in New Issue
Block a user