aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/exp
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2013-02-28 15:27:52 -0800
committerRobert Griesemer <gri@golang.org>2013-02-28 15:27:52 -0800
commit3a9fcc45f6938e2198d748a78f7c8b9c26692fad (patch)
tree881ac7243a634d30ad30c44e972d465b4e470177 /src/pkg/exp
parent38d4d3c66a2aaaa7e4a73d197bbe425116b8ef49 (diff)
downloadgo-3a9fcc45f6938e2198d748a78f7c8b9c26692fad.tar.xz
go/types: fix type-checking of shift expressions
Completely rethought shift expression type checking. Instead of attempting to type-check them eagerly, now delay the checking of untyped constant lhs in non- constant shifts until the final expression type becomes clear. Once it is clear, update the respective expression tree with the final (not untyped) type and check respective shift lhs' where necessary. This also cleans up another conundrum: How to report the type of untyped constants as it changes from untyped to typed. Now, Context.Expr is only called for an expresion x once x has received its final (not untyped) type (for constant initializers, the final type may still be untyped). With this CL all remaining std lib packages that did not typecheck due to shift errors pass now. TODO: There's a lot of residual stuff that needs to be cleaned up but with this CL all tests pass now. R=adonovan, axwalk CC=golang-dev https://golang.org/cl/7381052
Diffstat (limited to 'src/pkg/exp')
-rw-r--r--src/pkg/exp/gotype/gotype_test.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/pkg/exp/gotype/gotype_test.go b/src/pkg/exp/gotype/gotype_test.go
index 9e2fad0154..6d75782eac 100644
--- a/src/pkg/exp/gotype/gotype_test.go
+++ b/src/pkg/exp/gotype/gotype_test.go
@@ -16,6 +16,7 @@ func runTest(t *testing.T, path string) {
errorCount = 0
*recursive = false
+ *allErrors = true
if suffix := ".go"; strings.HasSuffix(path, suffix) {
// single file
path = filepath.Join(runtime.GOROOT(), "src/pkg", path)
@@ -64,7 +65,7 @@ var tests = []string{
"compress/bzip2",
"compress/flate",
"compress/gzip",
- // "compress/lzw",
+ "compress/lzw",
"compress/zlib",
"container/heap",
@@ -94,14 +95,14 @@ var tests = []string{
"database/sql",
"database/sql/driver",
- // "debug/dwarf",
+ "debug/dwarf",
"debug/elf",
"debug/gosym",
"debug/macho",
"debug/pe",
"encoding/ascii85",
- // "encoding/asn1",
+ "encoding/asn1",
"encoding/base32",
"encoding/base64",
"encoding/binary",
@@ -150,14 +151,14 @@ var tests = []string{
"log/syslog",
"math",
- //"math/big",
+ "math/big",
"math/cmplx",
"math/rand",
"mime",
"mime/multipart",
- // "net",
+ "net",
"net/http",
"net/http/cgi",
"net/http/fcgi",
@@ -179,25 +180,25 @@ var tests = []string{
"regexp",
"regexp/syntax",
- // "runtime",
+ "runtime",
"runtime/cgo",
"runtime/debug",
"runtime/pprof",
"sort",
- // "strconv",
+ "strconv",
"strings",
"sync",
"sync/atomic",
- // "syscall",
+ "syscall",
"testing",
"testing/iotest",
"testing/quick",
- // "text/scanner",
+ "text/scanner",
"text/tabwriter",
"text/template",
"text/template/parse",