gc: Better typechecks and errors in switches.

Allow any type in switch on interface value.
Statically check typeswitch early.

Fixes #2423.
Fixes #2424.

R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/5339045
diff --git a/test/fixedbugs/bug340.go b/test/fixedbugs/bug340.go
index 37731aa..34cc013 100644
--- a/test/fixedbugs/bug340.go
+++ b/test/fixedbugs/bug340.go
@@ -10,8 +10,8 @@
 
 func main() {
 	var x interface{}
-	switch t := x.(type) { // GC_ERROR "is not a type"
-	case 0:		// GCCGO_ERROR "expected type"
+	switch t := x.(type) {
+	case 0:		// ERROR "type"
 		t.x = 1 // ERROR "type interface \{\}|reference to undefined field or method"
 	}
 }