]> Cypherpunks repositories - gostls13.git/commitdiff
test: add test for findTypeLoop with symbols from other packages
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 16 Feb 2021 18:14:19 +0000 (01:14 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 23 Feb 2021 04:10:09 +0000 (04:10 +0000)
CL 274294 improved findTypeLoop but also fixed a new found bug on master
branch. This Cl adds test cases for this.

Updates #44266

Change-Id: Ie4a07a3487758a1e4ad2f2847dcde975b10d2a77
Reviewed-on: https://go-review.googlesource.com/c/go/+/292889
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>

test/fixedbugs/issue44266.go [new file with mode: 0644]

diff --git a/test/fixedbugs/issue44266.go b/test/fixedbugs/issue44266.go
new file mode 100644 (file)
index 0000000..c683e56
--- /dev/null
@@ -0,0 +1,23 @@
+// errorcheck
+
+// Copyright 2021 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
+
+import "io"
+
+type T1 interface {
+       io.Reader
+}
+
+type T2 struct {
+       io.SectionReader
+}
+
+type T3 struct { // ERROR "invalid recursive type T3"
+       T1
+       T2
+       parent T3
+}