aboutsummaryrefslogtreecommitdiff
path: root/test/alias2.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2017-01-23 14:24:24 -0800
committerMatthew Dempsky <mdempsky@google.com>2017-01-25 08:04:17 +0000
commitde2e5459aecb531a67dad274b789ffeb61dca020 (patch)
tree0ee90256f3e20059531dfb3d146ace755ec7d43d /test/alias2.go
parent9259f3073afe0830ab1484bfee46bfa1f322e7e7 (diff)
downloadgo-de2e5459aecb531a67dad274b789ffeb61dca020.tar.gz
go-de2e5459aecb531a67dad274b789ffeb61dca020.zip
[dev.typealias] cmd/compile: declare methods after resolving receiver type
For #18130. Fixes #18655. Change-Id: I58e2f076b9d8273f128cc033bba9edcd06c81567 Reviewed-on: https://go-review.googlesource.com/35575 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'test/alias2.go')
-rw-r--r--test/alias2.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/alias2.go b/test/alias2.go
index 58eedf0c8c..32c3654995 100644
--- a/test/alias2.go
+++ b/test/alias2.go
@@ -37,8 +37,8 @@ type (
// Methods can be declared on the original named type and the alias.
func (T0) m1() {} // GCCGO_ERROR "previous"
func (*T0) m1() {} // ERROR "method redeclared: T0\.m1|redefinition of .m1."
-func (A0) m1() {} // TODO(gri) this should be an error // GCCGO_ERROR "redefinition of .m1."
-func (A0) m1() {} // ERROR "A0\.m1 redeclared in this block|redefinition of .m1."
+func (A0) m1() {} // ERROR "T0\.m1 redeclared in this block|redefinition of .m1."
+func (A0) m1() {} // ERROR "T0\.m1 redeclared in this block|redefinition of .m1."
func (A0) m2() {}
// Type aliases and the original type name can be used interchangeably.
@@ -95,10 +95,10 @@ type _ = reflect.ValueOf // ERROR "reflect.ValueOf is not a type|expected type"
func (A1) m() {} // ERROR "cannot define new methods on non-local type int|may not define methods on non-local type"
func (A2) m() {} // ERROR "invalid receiver type"
func (A3) m() {} // ERROR "cannot define new methods on non-local type reflect.Value|may not define methods on non-local type"
-func (A4) m() {} // ERROR "cannot define new methods on non-local type reflect.Value|may not define methods on non-local type"
+func (A4) m() {} // ERROR "reflect.Value.m redeclared in this block" "cannot define new methods on non-local type reflect.Value|may not define methods on non-local type"
type B1 = struct{}
-func (B1) m() {} // ERROR "invalid receiver type"
+func (B1) m() {} // ERROR "m redeclared in this block" "invalid receiver type"
// TODO(gri) expand