Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
spec: add duplicate nil to the implementation restriction for switches #28378
For what it's worth, cmd/compile only warns about duplicate nils for switches on non-interface expressions. That is, it doesn't warn about duplicate nil for switches on interface expressions or at all in map literals.
I'm working on a CL to unify this code. My inclination is to just stop warning about duplicate nils, rather than relax the spec to allow this. We don't even report them correctly, so I doubt anyone's triggering this in practice: