X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/ad303446f43c0029e989a8a3d17c4936965d2c43..89ef4001b93c0219096c94125e7e9fdb745d2c97:/src/method-aggregate.lisp diff --git a/src/method-aggregate.lisp b/src/method-aggregate.lisp index c8791af..cec6f14 100644 --- a/src/method-aggregate.lisp +++ b/src/method-aggregate.lisp @@ -185,12 +185,8 @@ (let ((wanted (aggregating-message-method-return-type message (sod-message-combination message))) (msgtype (sod-message-type message))) - (unless (c-type-equal-p (c-type-subtype type) wanted) - (error "Method return type ~A doesn't match message ~A" - (c-type-subtype msgtype) (c-type-subtype type))) - (unless (argument-lists-compatible-p (c-function-arguments msgtype) - (c-function-arguments type)) - (error "Method arguments ~A don't match message ~A" type msgtype)))) + (check-method-return-type type wanted) + (check-method-argument-lists type msgtype))) ;;;-------------------------------------------------------------------------- ;;; Utilities. @@ -379,7 +375,7 @@ :methods (lambda (invoke) (funcall invoke val) (emit-inst codegen (make-if-inst (format nil "~A > ~A" acc val) - (make-set-inst acc val) nil)))) + (make-set-inst acc val))))) (define-aggregating-method-combination :max ((acc val) :codegen codegen) :first-method (lambda (invoke) @@ -388,7 +384,7 @@ :methods (lambda (invoke) (funcall invoke val) (emit-inst codegen (make-if-inst (format nil "~A < ~A" acc val) - (make-set-inst acc val) nil)))) + (make-set-inst acc val))))) (define-aggregating-method-combination :and ((ret) :codegen codegen) :around (lambda (body) @@ -399,7 +395,7 @@ :methods (lambda (invoke) (funcall invoke ret) (emit-inst codegen (make-if-inst (format nil "!~A" ret) - (make-break-inst) nil)))) + (make-break-inst))))) (define-aggregating-method-combination :or ((ret) :codegen codegen) :around (lambda (body) @@ -409,7 +405,7 @@ (make-do-while-inst (codegen-pop-block codegen) 0))) :methods (lambda (invoke) (funcall invoke ret) - (emit-inst codegen (make-if-inst ret (make-break-inst) nil)))) + (emit-inst codegen (make-if-inst ret (make-break-inst))))) ;;;-------------------------------------------------------------------------- ;;; A customizable aggregating method combination.