﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
943	typed-records: defstruct breaks with default values	megane	felix winkelmann	"The expected output is shown in case 3. In this case the slot for 'a' is defined as `(a : fixnum)`.

If the default is given the slot and accessor indices are reversed, and with `-specialized` just the slot indices are reversed.

{{{
(use typed-records)

(defstruct bar
  ((a 100) : fixnum)
  (b : fixnum))

(define (create-bar a)
  (let* [(b (make-bar a: a b: 42))]
    (print ""(bar-a b) "" (bar-a b))
    (print ""(bar-b b) "" (bar-b b))
    (print ""(##sys#slot b 1) "" (##sys#slot b 1))
    (print ""(##sys#slot b 2) "" (##sys#slot b 2))
    b))

(create-bar 1)

;; 1. no -specialize
;; (bar-a b) 1
;; (bar-b b) 42
;; (##sys#slot b 1) 42
;; (##sys#slot b 2) 1

;; 2. with -specialize
;; (bar-a b) 42
;; (bar-b b) 1
;; (##sys#slot b 1) 42
;; (##sys#slot b 2) 1

;; 3. without the default `100' for slot `a'
;; (bar-a b) 1
;; (bar-b b) 42
;; (##sys#slot b 1) 1
;; (##sys#slot b 2) 42

}}}"	defect	closed	major	someday	extensions	4.8.x	fixed			
