-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve recursive type issue #19
Comments
This was fixed for the types here manually to get things working and the tests passing, but we need to upstream a fix to the fundamental issue in go-ipld-prime. An issue to track that is opened at #20, it includes other code gen issues other than this recursive one. |
This is currently a poorly documented / alpha API issue, sorry about the discoverability -- If you've got a union in there somewhere, you can probably fix this with a bit of config which tells the codegen to use interfaces (which use pointers, and thus break the cycle problem), like this: Alternatively, if you haven't got a union, but you've got a maybe (either a nullable or an optional, or both at once) somewhere, then you can use this kind of config (except set it to If you don't have either of those -- well, you must, actually :) otherwise the schema would be describing a structure that would legitimaty be infinite in size, which would be a bad schema. (We intended to put a better configuration interface on this thing, but are in a bit of a tumble with prioritization lately, unfortunately.) |
The current IPLD code gen creates recursive types (
TrieNode
) that won't compile.This is also an issue for go-codec-dagcosmos (
MerkleTreeNode
,IAVLNode
, andSMTNode
are all recursive types).The text was updated successfully, but these errors were encountered: