]> Cypherpunks repositories - gostls13.git/commit
spec: type assertions and type switches must be valid
authorRobert Griesemer <gri@golang.org>
Thu, 6 Dec 2012 17:17:20 +0000 (09:17 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 6 Dec 2012 17:17:20 +0000 (09:17 -0800)
commit485673188dc6c3ee3113990ed1e96ca8f8f0df51
treec8e3fd99782ada63f844770dccc50025b60a80ef
parent9146ac14ee1e7516e2bb4212c0fcf054c6dde640
spec: type assertions and type switches must be valid

The spec didn't preclude invalid type assertions and
type switches, i.e., cases where a concrete type doesn't
implement the interface type in the assertion in the first
place. Both, the gc and gccgo compiler exclude these cases.
This is documenting the status quo.

Also:
- minor clean up of respective examples
- added sentence about default case in select statements

Fixes #4472.

R=rsc, iant, r, ken
CC=golang-dev
https://golang.org/cl/6869050
doc/go_spec.html