@ianlancetaylor Ah, I wasn't aware that variable bindings and types were intended to share the same namespace. In that case, perhaps issue a warning when a variable name shadows a type name or vice versa? If not that, then perhaps this specific error could be modified to look at the shadowed names and see if any of them is a type, and give an appropriate hint? I haven't looked at how Go's name resolution works, so I'm not sure how hard that would be in practice, but I'd be happy to try and put a PR together if one of these options sounds good to you.
There are two reasons for having no warnings. First, if it's worth complaining about, it's worth fixing in the code. (And if it's not worth fixing, it's not worth mentioning.) Second, having the compiler generate warnings encourages the implementation to warn about weak cases that can make compilation noisy, masking real errors that should be fixed.
@bradfitz I didn't mean to suggest some greater internal policy change-- do you have an alternative that you would prefer to see? Erroring on bindings-shadowing-types is obviously a breaking change and therefore a non-option. I suppose that leaves my second suggestion:
If not that, then perhaps this specific error could be modified to look at the shadowed names and see if any of them is a type, and give an appropriate hint?