I'm trying to use the generic graph library in typed racket, by importing it with require/typed, but I keep getting these weird long errors. Has anyone managed to get the type checker to cooperate with the generic graph library?
#lang typed/racket
(require/typed graph
[#:opaque Graph graph?]
[unweighted-graph/undirected ((Listof (List Any Any)) -> Graph)]
[add-edge! (Graph Any Any -> Void)])
(define g : Graph (unweighted-graph/undirected '((1 2) (1 3))))
(add-edge! g 2 3)
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?)
import/typedorrequire/typed? I'm pretty sure you mean the latter, but this could be the cause of the issue? - Lazerbeak12345require/typed, theimportwas a typo on my part. Not causing these issues tho - Alex MacLean