From 9f834a559c9ed6cdf883e29b36e21e5f956df74f Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Thu, 16 Feb 2023 15:53:42 -0800 Subject: [PATCH] test: add regress test for #58572 Fixes #58572. Change-Id: I75fa432afefc3e036ed9a6a9002a29d7b23105ee Reviewed-on: https://go-review.googlesource.com/c/go/+/468880 Reviewed-by: Keith Randall TryBot-Result: Gopher Robot Reviewed-by: Cuong Manh Le Run-TryBot: Matthew Dempsky Auto-Submit: Matthew Dempsky --- test/fixedbugs/issue58572.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/fixedbugs/issue58572.go diff --git a/test/fixedbugs/issue58572.go b/test/fixedbugs/issue58572.go new file mode 100644 index 0000000000..7461d593af --- /dev/null +++ b/test/fixedbugs/issue58572.go @@ -0,0 +1,29 @@ +// compile + +// Copyright 2023 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 p + +func New() resource { + return &Client{} +} + +type resource interface { + table() +} + +type Client struct { + m map[Key1]int +} + +func (c *Client) table() {} + +type Key1 struct { + K Key2 +} + +type Key2 struct { + f [2]any +}