Hacker News new | past | comments | ask | show | jobs | submit login

> My question is: what are the legitimate use cases for interfaces that are half-nil?

I think that's two different questions:

* Is there a legitimate use case for nil not being nil? I don't think so.

* Is there a legitimate use case for having "typed nil" interfaces? Kinda, Go supports and encourages calling methods "with nil receivers", and doing that through an interface requires that the concrete type (the non-nil half) be conserved otherwise you can't dispatch the method call.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: