Wrap functions in struct fields in `reflect.Value` to have a consistent
representation of function inside and outside the interpreter.
Teach assign to wrap a function node if destination is reflect.Value
The same needs to be done for composite literal, in a next commit.
The field index computed from the key value expression in sparse
composite literal was stored in `node.findex`, corrupting the memory
allocation. It is now stored in a local variable for immediate use.
Type category `UnsetT` is renamed in `NilT`.
Catch invalid use of untyped nil in `:=` expression.
Convert nil to output parameter type when used in `return` expression.
Improve and add relevant unit tests.
Call genNodeWrapper on interpreted function returned by a closure,
itself being wrapped, to ensure that the function can be called from
binary, no matter the level of nesting closures.
At CFG, in pre-order processing, determine the correct type of CompositeLitExpr from its first child (if it's a type) or from the ancestor node.
Make sure The type is propagated to children so the algorithm works recursively.
Fix also the isType() method to handle case of imported types,
either from source or binary packages.
Do not ignore type node when used in a variable declaration with assign.
The source node in a assign node can be the 2nd or the 3rd (the 2nd being the type).
The code for comparison operators is now generated by genop.
The support for multiple type has been added.
Missing operators <= and >= are now implemented.
Add `cmd/genop` program to generate operator functions in `interp/op.go`.
For each operator, determine its type, handle argument types conversion if necessary.
Arithmetic operators are added for now. Assign and comparison operators coming in a next commit.
The recovered state is stored in `Frame`, and captured in `runCfg()`.
`assign()` has been modified to set handle `interface{}` type (not
possible with `reflect`.
* style: fix warnings from golangci-lint printed by `make check`
* style: err assign in if block when possible. Better use of switch/case
* style: err assign in if block when possible
* ast: improve error handling
* ast: handle select
* dyngo: set filename of executed script
* cfg: improve error reporting
* Implement select for receiving channels
* feat(select): add support for sending channels in case clauses
* test: improve tests on select
* feat(select): add support for "default" case
Function typeAssert() now returns the concrete value of interface{}
object defined in the runtime.
What is missing is actual type checking against provided type, and
support for the variant returning 2 values, the concrete value and
boolean status.