4 ms·
That is not really what's going on here. If you replaced the interface in the OP's example with the actual type being returned, the nil comparison would work as
by chc 4y ago
That is not really what's going on here. If you replaced the interface in the OP's example with the actual type being returned, the nil comparison would work as expected. It isn't that the interface is allowing a comparison that would otherwise cause a build error — the interface is creating an error that wouldn't exist otherwise.