@@ -161,6 +161,15 @@ (define-syntax make-syntactic-constructor
(record-error 'name s "extraneous field initializers ~a"
unexpected)))
+ ;; Make sure all mandatory and innate fields are included.
+ (let* ((fields (map (compose car syntax->datum) field+value))
+ (optional (map (compose car syntax->datum) 'defaults))
+ (mandatory (lset-difference eq? '(expected ...) optional))
+ (mandatory+innate (lset-intersection eq? mandatory 'innate))
+ (missing (lset-difference eq? mandatory+innate fields)))
+ (when (pair? missing)
+ (record-error 'name s "missing field initializers ~a" missing)))
+
#`(make-struct/no-tail type
#,@(map (lambda (field index)
(or (field-inherited-value field)