You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 true, to get a pointer):
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: