Hi all,

I note that Racket 6.6 now issues warnings for certain generated
contracts in typed/untyped interactions.  In particular, these warnings
come up when requiring an untyped file from a typed file.  For example,
say I have

test.rkt:
---------
#lang racket


(define my-type
 (let ()
  (struct my-type () )
  (my-type)))
(define (my-type? x)
 (eq? x my-type))


(provide my-type? my-type)

And follow that with type interactions:

$ racket -I typed/racket
Welcome to Racket v6.6.
-> (require/typed "test.rkt" [#:opaque My-Type my-type?] [my-type My-Type])
my-type?: contract violation
  any-wrap/c: Unable to protect opaque value passed as `Any`
  value: #<my-type>
  This warning will become an error in a future release.
  in: the 1st argument of
      a part of the or/c of
      (or/c
       struct-predicate-procedure?/c
       (-> Any boolean?))
  contract from: (interface for my-type?)
  blaming: top-level
   (assuming the contract is correct)
  at: readline-input:1.44

I use a similar pattern to call the untyped db library from typed code,
say with
(require/typed db [#:opaque Sql-Null] [sql-null Sql-Null]), which would
bring up a similar warning.

Is there a "correct" way to handle these sorts of cases?

Thanks!

Matthew Eric


-- 
Matthew Eric Bassett | http://mebassett.info

-- 
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.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to