This PR fixes issues like #1457 #1601 by importing the source code for generic functions in extracted Go code, so that it can be interpreted in yaegi.
You need to add a //yaegi:add comment directive to functions to so import, as importing all generic functions might not be desirable or feasible. In particular, given the need to interpret the generic code, it can not access any non-exported functions, types, or fields.
The extracted code is wrapped in a GenericFunc string type value as below:
This PR fixes issues like #1457 #1601 by importing the source code for generic functions in extracted Go code, so that it can be interpreted in yaegi.
You need to add a
//yaegi:add
comment directive to functions to so import, as importing all generic functions might not be desirable or feasible. In particular, given the need to interpret the generic code, it can not access any non-exported functions, types, or fields.The extracted code is wrapped in a
GenericFunc
string type value as below:This PR builds on #1642 which interacts with this code in extracting the function source.