]> Cypherpunks repositories - gostls13.git/commit
spec: clarify rules for receiver base types
authorRobert Griesemer <gri@golang.org>
Tue, 16 Oct 2018 23:50:25 +0000 (16:50 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 17 Oct 2018 20:03:35 +0000 (20:03 +0000)
commitbb3e2117777a2d9438bab0ab9e386e22662aa499
treeca845c8a74aef61eeaf8d001a55d3686101a2e04
parentdc75744f9c16e6af08f3e4677f28850b874ecc51
spec: clarify rules for receiver base types

The spec currently provides a syntactic rule for receiver base types,
and a strict reading of those rules prohibits the use of type aliases
referring to pointer types as receiver types.

This strict interpretation breaks an assumed rule for aliases, which
is that a type literal can always be replaced by an alias denoting
that literal.

Furthermore, cmd/compile always accepted this new formulation of the
receiver type rules and so this change will simply validate what has
been implemented all along.

Fixes #27995.

Change-Id: I032289c926a4f070d6f7795431d86635fe64d907
Reviewed-on: https://go-review.googlesource.com/c/142757
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
doc/go_spec.html