From deb678cebf368fd9fb4f2e1cc1a8ea950ee7f5df Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 29 Jul 2020 21:41:51 -0700 Subject: [PATCH] [dev.go2go] go/types: add testcase for crash 9 of #39634 This test passes type-checking without problems but the generated code causes a cmd/compile error (filed #40486). Updates #39634. Change-Id: If3dd28605f6d8792c6bd5bb032624e9a6140b2c0 Reviewed-on: https://go-review.googlesource.com/c/go/+/245742 Reviewed-by: Robert Griesemer --- src/go/types/fixedbugs/issue39634.go2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/go/types/fixedbugs/issue39634.go2 b/src/go/types/fixedbugs/issue39634.go2 index b4f6cbed80..0de085ee06 100644 --- a/src/go/types/fixedbugs/issue39634.go2 +++ b/src/go/types/fixedbugs/issue39634.go2 @@ -30,6 +30,10 @@ type foo8(type A) interface { type A } func bar8(type A foo8(A))(a A) {} func main8() {} +// crash 9 +type foo9(type A) interface { type foo9(A) } +func _() { var _ = new(foo9(int)) } + // crash 12 var u /* ERROR cycle */ , i [func /* ERROR used as value */ /* ERROR used as value */ (u, c /* ERROR undeclared */ /* ERROR undeclared */ ) {}(0, len)]c /* ERROR undeclared */ /* ERROR undeclared */