Hi everyone,

I am trying to add a contract to a class but find that the mere presence
of the contract breaks my code. Here is a minimal example that illustrates
the problem:

--------------------------------------------------
#lang racket

(define foo%
  (class object%
    (inspect #f)
    (super-new)
    (init-field value)))

(define/contract foo+c%
  (class/c (init [value symbol?]))
  foo%)

(module+ test
  (require rackunit)
  (check-equal? (make-object foo% 'bar)
                (make-object foo% 'bar))
  (check-equal? (make-object foo+c% 'bar)
                (make-object foo+c% 'bar)))
--------------------------------------------------

My class foo% declares (inspect #f) to ensure that foo% objects can be
compared using equal?. As the test shows, this works fine. However, as
soon as I add a contract to my class, equality tests fail
systematically.

Am I using class contracts incorrectly? Or is this a bug, or a
feature?  Is there a workaround?

Thanks in advance,
  Konrad

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to