fix: typed links LinkTargetNodePrototype should return ReferencedType
Found in integrating into go-ipfs
which wants to load typed nodes when it encounters typed links. It errors
because it's trying to load the typed node into the type of the typed link
rather than the referenced type.
@@ -53,7 +53,7 @@ func (g linkGenerator) EmitTypedNodeMethodType(w io.Writer) {
if g.Type.HasReferencedType() {
doTemplate(`
func ({{ .Type | TypeSymbol }}) LinkTargetNodePrototype() ipld.NodePrototype {
- return Type.{{ .Type | TypeSymbol }}__Repr
+ return Type.{{ .Type.ReferencedType | TypeSymbol }}__Repr
}
`, w, g.AdjCfg, g)
}
