]> Cypherpunks repositories - gostls13.git/commitdiff
Don't use fallthrough in a type switch.
authorIan Lance Taylor <iant@golang.org>
Fri, 30 Oct 2009 23:10:42 +0000 (16:10 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 30 Oct 2009 23:10:42 +0000 (16:10 -0700)
R=rsc
http://go/go-review/1018005

src/pkg/exp/eval/world.go

index a5e4e6092beda0d7b762bbeb803d28aaf85c80dd..331aa3087464ebe323e2728794b1b04d8379cf79 100644 (file)
@@ -111,12 +111,10 @@ func (w *World) CompileExpr(e ast.Expr) (Code, os.Error) {
                // nothing
        case *idealFloatType:
                // nothing
-       case *MultiType:
-               if len(t.Elems) == 0 {
+       default:
+               if tm, ok := t.(*MultiType); ok && len(tm.Elems) == 0 {
                        return &stmtCode{w, code{ec.exec}}, nil;
                }
-               fallthrough;
-       default:
                eval = genAssign(ec.t, ec);
        }
        return &exprCode{w, ec, eval}, nil;