]> Cypherpunks repositories - gostls13.git/commitdiff
fix build: use temporary variable to avoid compiler error
authorRobert Griesemer <gri@golang.org>
Mon, 8 Oct 2012 01:16:04 +0000 (18:16 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 8 Oct 2012 01:16:04 +0000 (18:16 -0700)
R=r
CC=golang-dev
https://golang.org/cl/6612066

src/pkg/exp/types/staging/types_test.go

index d6ddfabc3111621b981b83dae3d916d16177d5b6..e6959bceeb0e0d260baec10cb014585ce0d1de27 100644 (file)
@@ -169,7 +169,10 @@ func TestExprs(t *testing.T) {
                        t.Errorf("%s: %s", src, err)
                        continue
                }
-               expr := pkg.Files[filename].Decls[0].(*ast.GenDecl).Specs[0].(*ast.ValueSpec).Values[0]
+               // TODO(gri) writing the code below w/o the decl variable will
+               //           cause a 386 compiler error (out of fixed registers)
+               decl := pkg.Files[filename].Decls[0].(*ast.GenDecl)
+               expr := decl.Specs[0].(*ast.ValueSpec).Values[0]
                str := exprString(expr)
                if str != test.str {
                        t.Errorf("%s: got %s, want %s", test.src, str, test.str)