-
-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
1 parent
daa3bfc
commit ab801d4
Showing
4 changed files
with
40 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters