all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#67785: Unhelpful error message when a mandatory & innate field is missing after inheritance
@ 2023-12-11 19:48 Skyler Ferris via Bug reports for GNU Guix
  0 siblings, 0 replies; only message in thread
From: Skyler Ferris via Bug reports for GNU Guix @ 2023-12-11 19:48 UTC (permalink / raw)
  To: 67785

Normally, when a field is missing Guix provides a helpful error message 
explaining the precise problem:

(define-record-type <t> t make-t t? this-t

   (mandatory-field t-mandatory-field))

(t) => t: missing field initializers (mandatory-field) in form (t)

However, if the field is innate, a value is inherited, and the mandatory 
field is missing, the error message is not helpful:

(define-record-type <t> t make-t t? this-t

   (mandatory-field t-mandatory-field)

   (innate-mandatory-field t-innate-mandatory-field (innate))

(define base (t (mandatory-field #t) (innate-mandatory-field #t)))

(t (inherit base)) =>

Backtrace:
           12 (primitive-load "/tmp/test.scm")
In ice-9/eval.scm:
    721:20 11 (primitive-eval (t (inherit base)))
In ice-9/psyntax.scm:
   1229:36 10 (expand-top-sequence (#<syntax:test.scm:6:0 (t #<synt…>) …)
   1121:20  9 (parse _ (("placeholder" placeholder)) ((top) #(# # …)) …)
   1342:32  8 (syntax-type (t #<syntax:test.scm:6:3 (inherit base)>) # …)
   1562:32  7 (expand-macro #<procedure 7f793c5d10e0 at ice-9/eval.s…> …)
In ice-9/eval.scm:
    191:35  6 (_ #(#(#<directory (guix-user) 7f7940782a00> #<va…> …) …))
     163:9  5 (_ #(#(#<directory (guix-user) 7f7940782a00> #<va…> …) …))
    191:35  4 (_ #(#(#(#<directory (guix-user) 7f7940782a00> # …) …) …))
In srfi/srfi-1.scm:
    603:19  3 (map2 (innate-mandatory-field mandatory-field) (0 1) 2)
In ice-9/eval.scm:
    196:43  2 (_ #(#(#(#<directory (guix-user) 7f7940782a00> # …) …) …))
     155:9  1 (_ _)
In ice-9/boot-9.scm:
   1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure car: Wrong type argument in position 1 (expecting pair): #f






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-11 19:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-11 19:48 bug#67785: Unhelpful error message when a mandatory & innate field is missing after inheritance Skyler Ferris via Bug reports for GNU Guix

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.