mirror of
https://github.com/golang/go
synced 2024-11-14 21:10:29 -07:00
c32566c336
Use a map to detect recursive types. With this we can now typecheck fixedbugs/issue8501.go. Updates #43088. Change-Id: I7fad6ccf6c94268473ff72b09a3158e13a7f4cc3 Reviewed-on: https://go-review.googlesource.com/c/go/+/276374 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
17 lines
379 B
Go
17 lines
379 B
Go
// errorcheck
|
|
|
|
// Copyright 2014 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.
|
|
|
|
// issue 8507
|
|
// used to call algtype on invalid recursive type and get into infinite recursion
|
|
|
|
package p
|
|
|
|
type T struct{ T } // ERROR "invalid recursive type T|cycle"
|
|
|
|
func f() {
|
|
println(T{} == T{})
|
|
}
|