mirror of
https://github.com/hanzoai/expr.git
synced 2026-09-24 16:58:58 +00:00
* Update vm.go
golang gotcha: reflect calls with nil params fail without this trick
* Update vm.go
* Problem with passing "nil" when operators are overloaded with interface{} type parameters fixed
e.g.
a != nil
was not working when "!=" is overloaded with
func notEqual(a, b interface{}) interface{} {...}
* Compile fix
Forgot to close ")"
* Added test that illustrates what did not work when using overloaded operators and passing nil
* Updated test for overloaded eaqal with using nil
a == b replaced with a == nil to illustrated the problem when using nil directly in expression
* Fixed the problem for untyped nil
We use the trick only for untyped nil:
https://play.golang.org/p/MyAztoZaqhx
* Refactor call procedure
Co-authored-by: wintermute-cds <[email protected]>