Fix error message for 1-arg apply
This commit is contained in:
parent
7a1538764e
commit
1e15ce1f32
|
@ -812,6 +812,7 @@
|
||||||
([j : Natural (+ i 'a) (+ j i)])
|
([j : Natural (+ i 'a) (+ j i)])
|
||||||
((>= j 10))
|
((>= j 10))
|
||||||
#f)]
|
#f)]
|
||||||
|
[tc-err (apply +)]
|
||||||
[tc-e/t
|
[tc-e/t
|
||||||
(let ([x eof])
|
(let ([x eof])
|
||||||
(if (procedure? x)
|
(if (procedure? x)
|
||||||
|
|
|
@ -257,7 +257,11 @@
|
||||||
;; produces the first n-1 elements of the list, and the last element
|
;; produces the first n-1 elements of the list, and the last element
|
||||||
(define (split l) (let-values ([(f r) (split-at l (sub1 (length l)))])
|
(define (split l) (let-values ([(f r) (split-at l (sub1 (length l)))])
|
||||||
(values f (car r))))
|
(values f (car r))))
|
||||||
(define-values (fixed-args tail) (split (syntax->list args)))
|
(define-values (fixed-args tail)
|
||||||
|
(let ([args* (syntax->list args)])
|
||||||
|
(if (null? args*)
|
||||||
|
(tc-error "apply requires a final list argument, given only a function argument of type ~a" (match f-ty [(tc-result1: t) t]))
|
||||||
|
(split args*))))
|
||||||
|
|
||||||
(match f-ty
|
(match f-ty
|
||||||
[(tc-result1: (Function: (list (arr: doms rngs rests drests (list (Keyword: _ _ #f) ...)) ...)))
|
[(tc-result1: (Function: (list (arr: doms rngs rests drests (list (Keyword: _ _ #f) ...)) ...)))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user