From d1bfa6a2039e224b3f13094ab4bb49b1f4a33139 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 23 Nov 2019 15:39:27 -0500 Subject: [PATCH] cs: fix error reporting for struct selectors Fix error reporting for non-inlined struct selectors to use Racket style instead of Chez Scheme style. Closes #2926 --- racket/src/cs/rumble/struct.ss | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/racket/src/cs/rumble/struct.ss b/racket/src/cs/rumble/struct.ss index 6a355eb2bd..7e928ac625 100644 --- a/racket/src/cs/rumble/struct.ss +++ b/racket/src/cs/rumble/struct.ss @@ -664,9 +664,9 @@ (procedure-rename (lambda (v) ($value - (if (impersonator? v) - (impersonate-ref p rtd pos v rec-name (or name 'field)) - (p v)))) + (if (record? v rtd) + (p v) + (impersonate-ref p rtd pos v rec-name (or name 'field))))) (string->symbol (string-append (symbol->string rec-name) "-" (if name @@ -702,9 +702,9 @@ (procedure-rename (if (struct-type-field-mutable? rtd pos) (lambda (v a) - (if (impersonator? v) - (impersonate-set! p rtd pos abs-pos v a rec-name (or name 'field)) - (p v a))) + (if (record? v rtd) + (p v a) + (impersonate-set! p rtd pos abs-pos v a rec-name (or name 'field)))) (lambda (v a) (raise-arguments-error name "cannot modify value of immutable field in structure"