Subject: bug#37283: closed (Re: bug#37283: 27.0.50; Struct defined by cl-defstruct with :noinline failed to set slot using setf)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 09 Sep 2019 21:35:02 +0000

Your bug report

#37283: 27.0.50; Struct defined by cl-defstruct with :noinline failed to set slot using setf

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
37283: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=37283
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#37283: 27.0.50; Struct defined by cl-defstruct with :noinline failed to set slot using setf
From: Stefan Monnier <[email-masked]>
To: [email-masked]
Date: Mon, 09 Sep 2019 17:34:38 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

> Yes, this snippet work as expected now. Thanks for your work.

Subject: 27.0.50; Struct defined by cl-defstruct with :noinline failed to set slot using setf
From: Zhu Zihao <[email-masked]>
To: [email-masked]
Date: Mon, 02 Sep 2019 21:09:31 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Start Emacs with "emacs -Q" and run following code

(require 'cl-lib)
(cl-defstruct (stt (:noinline t))
  slt-a slt-b)

(let ((inst (make-stt :slt-a 1 :slt-b 2)))
  (setf (stt-slt-a inst) 2))

Will get error "Symbol’s function definition is void: \(setf\ stt-slt-a\)"

It seems that the accessors of struct defined with :noinline can't be expand
with "setf" directly.

This issue probably introduced at commit 144b2243b7cee4adbc3217d871c575921f95af54.