Re:Golang generics proposal has been accepted
by andreygrehov on Thursday February 11, 2021 @01:25PM
(#26105231)
What would be a better design?
Re:Golang generics proposal has been accepted
by dragonwriter on Thursday February 11, 2021 @02:36PM
(#26106063)
Statically requiring a (the default case) non-nillable pointer to be assigned to a non-nil value (presumably, ultimately as a result of an operation that fails if it can't allocate, or one that either fails or returns a non-nil pointer when passed a nillable pointer) before being used?
The same thing as is done for any other non-nullable value in static type systems.
It's certainly common, but of the things which would be useful to be able to constrain only to allow explicit and non-default nillability, pointers are pretty high on the list.