Skip to content

Commit

Permalink
fix: typed links LinkTargetNodePrototype should return ReferencedType
Browse files Browse the repository at this point in the history
Found in ipfs/go-ipld-git#46 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.
  • Loading branch information
rvagg committed Jul 26, 2021
1 parent ebe39c7 commit efa1ca3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion schema/gen/go/genLink.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit efa1ca3

Please sign in to comment.