@@ -1223,12 +1223,22 @@ (define* (fold-services services
(params -> (service-value sink))
(service
->
- ;; Distinguish COMPOSE and EXTEND because PARAMS typically
- ;; has a different type than the elements of EXTENSIONS.
- (if extend
- (service (service-kind sink)
- (extend params (compose extensions)))
- sink)))
+ (begin
+ (unless (or (null? extensions)
+ ;; A value of #t is a convention for "make
+ ;; sure the service is present."
+ (every (cut eq? #t <>) extensions)
+ (and extend compose))
+ (error (format #f "Extensions are not supported in \
+~a yet the following service types extend it:~{~% ~a~}"
+ (service-kind sink)
+ (map service-kind dependents))))
+ ;; Distinguish COMPOSE and EXTEND because PARAMS typically
+ ;; has a different type than the elements of EXTENSIONS.
+ (if extend
+ (service (service-kind sink)
+ (extend params (compose extensions)))
+ sink))))
(mbegin %state-monad
(set-current-state (vhash-consq sink service visited))
(return service))))