Files
expr/internal
fa91adf0ac Allow passing nil to functions as nil interface{} (#87)
* 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]>
2020-02-20 16:59:15 +03:00
..