On 1/13/23 07:20, Gorka Guardiola wrote:
> According to the spec it seems like it is legal to shadow a type with a
> variable, even a builtin type.
> Is there any specific rationale for this? I guess that it makes scoping
> checks easier and faster, but still.
>
I don't think there is any special rationale behind it, in Go builtin
types are predefined identifiers, not keywords as usual in other
languages, thus those follow rules of identifiers, not keywords.
Although it feels astonishing that you can shadow even predefined
constants like "true := false", in my experience this haven't shown to
be an issue.
-w