]> Cypherpunks repositories - gostls13.git/commitdiff
gc: bug245
authorRuss Cox <rsc@golang.org>
Tue, 19 Jan 2010 01:30:15 +0000 (17:30 -0800)
committerRuss Cox <rsc@golang.org>
Tue, 19 Jan 2010 01:30:15 +0000 (17:30 -0800)
Fixes #529.

R=ken2
CC=golang-dev
https://golang.org/cl/186215

src/cmd/gc/sinit.c
src/cmd/gc/typecheck.c
test/fixedbugs/bug245.go [new file with mode: 0644]

index 1b618fddb2ae9100177572b227d5eca0f5c57fcf..fd73dc0ad17de9103fdde4c0f95739dfff160e41 100644 (file)
@@ -322,6 +322,7 @@ slicelit(Node *n, Node *var, NodeList **init)
        t = shallow(n->type);
        t->bound = mpgetfix(n->right->val.u.xval);
        t->width = 0;
+       t->sym = nil;
        dowidth(t);
 
        // make static initialized array
@@ -688,6 +689,7 @@ initctxt:
                t = shallow(t);
                t->bound = mpgetfix(n->right->right->val.u.xval);
                t->width = 0;
+               t->sym = nil;
                dowidth(t);
 
                // make static initialized array
index 0c18097dac54e016376c9c27aa2caef102cc95f3..f0866ae3bb05f65deb003ad8b87a008c1c9d6390 100644 (file)
@@ -1715,7 +1715,7 @@ typecheckcomplit(Node **np)
 
        memset(hash, 0, sizeof hash);
 
-       l = typecheck(&n->right /* sic */, Etype /* TODO | Edotarray */);
+       l = typecheck(&n->right /* sic */, Etype);
        if((t = l->type) == T)
                goto error;
        nerr = nerrors;
diff --git a/test/fixedbugs/bug245.go b/test/fixedbugs/bug245.go
new file mode 100644 (file)
index 0000000..6e5a8b3
--- /dev/null
@@ -0,0 +1,16 @@
+// $G $D/$F.go || echo BUG: bug245
+
+// Copyright 2010 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+type T []int
+func (t T) m()
+
+func main() {
+       _ = T{}
+}
+
+// bug245.go:14: fatal error: method mismatch: T for T