From f093cf90bff4bfc4e0a304283eef0d2445d67538 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sun, 26 Jun 2022 15:17:23 -0700 Subject: [PATCH] test: add test that caused gofrontend crash For #52871 Change-Id: Id6102222a8b1ec8a84b716425bed0e349c65dbc4 Reviewed-on: https://go-review.googlesource.com/c/go/+/414336 TryBot-Result: Gopher Robot Run-TryBot: Ian Lance Taylor Reviewed-by: Cherry Mui Reviewed-by: Than McIntosh --- test/fixedbugs/issue52871.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/fixedbugs/issue52871.go diff --git a/test/fixedbugs/issue52871.go b/test/fixedbugs/issue52871.go new file mode 100644 index 0000000000..d3731a183a --- /dev/null +++ b/test/fixedbugs/issue52871.go @@ -0,0 +1,17 @@ +// compile + +// Copyright 2022 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. + +// gofrontend crashed compiling this code. + +package p + +type S struct {} + +func (s *S) test(_ string) {} + +var T = [1]func(*S, string) { + (*S).test, +} -- 2.50.0