Summary

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

Metadata

Attachments

Description

This program

 
 (use typed-records)
 
 (define-record-type foo
   (make-foo bar)
   foo?
   (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.

Changes and comments

[2012-08-18 11:08:53 UTC] megane attached define-record-type-specializations.patch (description=#f)

[2012-08-18 11:16:03 UTC] megane wrote:

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

For example

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

instead of

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

[2012-08-18 11:18:37 UTC] megane wrote:

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!

[2012-08-18 15:27:17 UTC] felix changed status from new to assigned

[2012-08-18 15:27:17 UTC] felix set owner to felix

[2012-08-18 15:27:17 UTC] felix removed milestone 4.8.0

[2012-08-24 16:28:51 UTC] felix changed status from assigned to closed

[2012-08-24 16:28:51 UTC] felix set resolution to fixed

[2012-08-24 16:28:51 UTC] felix wrote:

Thanks - patch applied (0.3).