Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
node/bindnode: enforce pointer requirement for nullable maps
The implementation expected map value types in Go to be a pointer when the IPLD schema has the value as nullable. Unfortunately, we forgot to enforce that in verifyCompatibility, so the user could run into weird panics: panic: interface conversion: basicnode.plainList is not datamodel.Node: missing method Length The added test case in TestPrototypePointerCombinations reproduces the panic, but is commented out, because we're fixing the check logic to instead have bindnode panic upfront with a helpful message. Note that I understand why the user tried to avoid the pointer to Node. Since Node is an interface, it is already nilable, so bindnode can store a nil value in it directly without the need for a pointer. We do not support that right now, but soon will; #378 now tracks that. Fixes #377.
- Loading branch information