]> Cypherpunks repositories - gostls13.git/commit
cmd/gc: typecheck type switch variables
authorDmitry Vyukov <dvyukov@google.com>
Fri, 30 Jan 2015 08:23:22 +0000 (11:23 +0300)
committerDmitry Vyukov <dvyukov@google.com>
Tue, 3 Feb 2015 15:44:06 +0000 (15:44 +0000)
commit8e2423a67dab2fe8f218dc37bb31ec26aaad7c14
tree33cf012fbd90fe811a5176709a7f57936bdf6605
parentc9321f3fb13aec7af5c72d3d11a6e3b4d88dced3
cmd/gc: typecheck type switch variables

Type switch variables was not typechecked.
Previously it lead only to a minor consequence:

switch unsafe.Sizeof = x.(type) {

generated an inconsistent error message.
But capturing by value functionality now requries typechecking of all ONAMEs.

Fixes #9731

Change-Id: If037883cba53d85028fb97b1328696091b3b7ddd
Reviewed-on: https://go-review.googlesource.com/3600
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/gc/swt.c
test/fixedbugs/issue9731.go [new file with mode: 0644]