Opened 12 years ago

Closed 12 years ago

#899 closed defect (fixed)

typed-records: define-record-type constructor with arguments is specialized erroneously

Reported by: Moritz Heidkamp Owned by: felix winkelmann
Priority: minor Milestone:
Component: extensions Version: 4.8.x
Keywords: Cc:
Estimated difficulty:


This program

(use typed-records)

(define-record-type foo
  (make-foo bar)
  (bar foo-bar foo-bar-set!))

(display (make-foo 1))

fails with Error: unbound variable: bar when compiled with -specialize. Tested with 4.8.0rc2.

Attachments (1)

define-record-type-specializations.patch (1.0 KB) - added by megane 12 years ago.

Download all attachments as: .zip

Change History (5)

Changed 12 years ago by megane

comment:1 Changed 12 years ago by megane

The generated specializations had slot symbols in them where one would expect #(1) style references to the arguments.

For example

  (#(procedure) make-foo (fixnum) (struct foo))
  ((fixnum) (##sys#make-structure 'foo bar)))

instead of

  (#(procedure) make-foo (fixnum) (struct foo))
  ((fixnum) (##sys#make-structure 'foo #(1))))

comment:2 Changed 12 years ago by megane

I also noticed the egg uses `:' syntax to specify specializations (that get exported to the types file) although it's not documented anywhere that this is possible!

comment:3 Changed 12 years ago by felix winkelmann

Milestone: 4.8.0
Owner: set to felix winkelmann
Status: newassigned

comment:4 Changed 12 years ago by felix winkelmann

Resolution: fixed
Status: assignedclosed

Thanks - patch applied (0.3).

Note: See TracTickets for help on using tickets.