Compatibility or not, but if object field of interface is set to nil, then myVar == nil should return true, unlike bizzare behavior now!
Right now it's possible to get nil interface from one func, return it from another resulting in hidden cast, and this returned value fails nil check. This leads to hidden bugs, and code like this:
p = makeP()
if p == nil {
return nil
}
return p
and all this can be avoided by not requiring both fields of interface to be nil for successful nil check.
I sure hope this will be fixed at least in 2.
Also finally we got max/min. Maybe it's time for, you know,
sets? Ordered_maps? Hashable slices? Ground breaking, I know.
Right now it's possible to get nil interface from one func, return it from another resulting in hidden cast, and this returned value fails nil check. This leads to hidden bugs, and code like this:
and all this can be avoided by not requiring both fields of interface to be nil for successful nil check.I sure hope this will be fixed at least in 2.
Also finally we got max/min. Maybe it's time for, you know, sets? Ordered_maps? Hashable slices? Ground breaking, I know.