On 1/20/21 10:42 AM, 'Axel Wagner' via golang-nuts wrote:
> IMO it is confusing to allow comparing generic values to nil, in general. If 
> we
> could, I would either assume I can compare any *non*-generic value to nil. I
> would assume we can always go from a generic function to an instantiated one 
> by
> substituting all occurrences of the type-parameters. But IMO, nil is already
> confusing enough as it is.
> 
> I think the solutions Patrick and Ian provided for checking if an interface is
> nil, or a value is zero, are enough. Because, to be clear: Calling a method on
> an interface can panic *whether or not that interface is nil*.

It looks to me like interfaces are causing a lot of problems in this proposal.
Although nil is largely a non issue in go compared to Dart where they are
pushing for migration to null soundness. I would personally like to see nil use
and related panics minimised further, if anything.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f2eb905c-90ce-653c-1d33-af352f05c782%40gmail.com.

Reply via email to