Hello,
Again, a question out of curiosity, because I think I found a solution, but I'd like to have something more elegant.
I'm trying to use the (untyped) Racket generic graph library from my Typed Racket code:
#lang typed/racket
(require/typed graph
[#:opaque Graph graph?]
[directed-graph (->* ((Listof (List Any Any))) ((Listof Any)) Graph)])
(directed-graph '((a b) (b c)))
When I load this code in the REPL I get
graph?: contract violation
any-wrap/c: Unable to protect opaque value passed as `Any`
value: #<unweighted-graph>
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 graph?)
blaming: <pkgs>/dds/tmp.rkt
(assuming the contract is correct)
at: <pkgs>/dds/tmp.rkt:4.18
#<unweighted-graph>
While this solution should fit me, I was wondering whether anybody here has encountered this issue and has a different solution.
-
Sergiu