mirror of
https://github.com/golang/go
synced 2024-11-15 01:10:21 -07:00
e22af33b48
If a cycle has length 1, don't enumerate the single cycle entry; instead just mention "refers to itself". For instance, for an invalid recursive type T we now report: invalid recursive type: T refers to itself instead of: invalid recursive type T T refers to T Adjust tests to check for the different error messages. Change-Id: I5bd46f62fac0cf167f0d0c9a55f952981d294ff4 Reviewed-on: https://go-review.googlesource.com/c/go/+/436295 Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Robert Griesemer <gri@google.com>
17 lines
397 B
Go
17 lines
397 B
Go
// errorcheck
|
|
|
|
// Copyright 2018 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
|
|
|
|
type I1 = interface {
|
|
I2
|
|
}
|
|
|
|
// BAD: type loop should mention I1; see also #41669
|
|
type I2 interface { // GC_ERROR "invalid recursive type: I2 refers to itself"
|
|
I1 // GCCGO_ERROR "invalid recursive interface"
|
|
}
|