DEFSTRUCT should signal error/warning if :PREDICATE + :TYPE without :NAMED

Bug #520607 reported by Tobias C. Rittweiler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Low
Unassigned

Bug Description

CLHS says

  A predicate can be defined only if the structure is named;
  if :type is supplied and :named is not supplied, then
  :predicate must either be unsupplied or have the value nil.

Yet SBCL compiles

(defstruct (typed-struct (:type list) (:predicate typed-struct-p))
  (a 42 :type fixnum))

silently, and it seems to ignore the :PREDICATE clause.

Tags: ansi
Changed in sbcl:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Roman Marynchak (roman-marynchak) wrote :

The patch for this problem, with the regression test.

tags: added: review
Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
status: Confirmed → In Progress
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

Doesn't handle

  (defstruct (foo (:type list) (:predicate nil)))

correctly.

tags: removed: review
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

Adjusted patch in my pending tree.

tags: added: pending
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

In 1.0.46.9.

Changed in sbcl:
assignee: Nikodemus Siivola (nikodemus) → nobody
status: In Progress → Fix Committed
tags: removed: pending
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.