anytype does not propogate through functions #6423
Labels
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
Given a function which takes an
anytype
and a function with signature dependent on that type, it's currently an unexpected compiler error to bind a function which takesanytype
Minimal Example:
results in:
A more practical example is the use of
std.sort.sort
which takes acontext
. If no context is required it should be possible to pass it an empty struct literal (.{}
). However the comparator used would then need to be able to handle the various literals passed through.e.g. this should work:
The text was updated successfully, but these errors were encountered: