fine-tune typechecking index entry

svn: r12920

original commit: ec600c59bb9caa15f10fb68844677e56a4ce86dc
This commit is contained in:
Matthew Flatt 2008-12-21 13:57:46 +00:00
parent 90abe67ff6
commit 000fe5277f

View File

@ -677,9 +677,11 @@
[(_ x ...) (begin (set! xs (syntax->list #'(x ...))) (do-fun))]))
(define (function-ptr p fun-ctype)
(if (cpointer? p)
(if (or (cpointer? p) (procedure? p))
(if (eq? (ctype->layout fun-ctype) 'fpointer)
((ctype-c->scheme fun-ctype) p)
(if (procedure? p)
((ctype-scheme->c fun-ctype) p)
((ctype-c->scheme fun-ctype) p))
(raise-type-error 'function-ptr "function ctype" fun-ctype))
(raise-type-error 'function-ptr "cpointer" p)))