From 59910f1834f5e6a52466d1583e4bc9a239c92a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 30 Sep 2025 10:43:18 +0200 Subject: [PATCH] =?UTF-8?q?records:=20=E2=80=98match-record=E2=80=99=20thr?= =?UTF-8?q?ows=20a=20well-formed=20=E2=80=99wrong-type-arg=E2=80=99=20exce?= =?UTF-8?q?ption.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/records.scm (match-record): Produce a well-formed ‘wrong-type-arg’ exception. Change-Id: I5bc16320326446baee15ff16bb7859469c97ac1d --- guix/records.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/guix/records.scm b/guix/records.scm index fb263ab6d77117f07d34af9388dc80809c3521ab..261f6f07b6ced81e5de0e4680b2c06957171f5e3 100644 --- a/guix/records.scm +++ b/guix/records.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012-2024 Ludovic Courtès +;;; Copyright © 2012-2025 Ludovic Courtès ;;; Copyright © 2018 Mark H Weaver ;;; ;;; This file is part of GNU Guix. @@ -671,7 +671,9 @@ an unknown field is queried." ((_ record type (fields ...) body ...) (if (eq? (struct-vtable record) type) (match-record-inner record type (fields ...) body ...) - (throw 'wrong-type-arg record))))) + (throw 'wrong-type-arg "match-record" + "Wrong type (expecting a ~a record): ~S" + (list 'type record) (list record)))))) (define-syntax match-record-lambda (syntax-rules ()