2013-08-29 02:16:09 -06:00
|
|
|
// errorcheck
|
|
|
|
|
|
|
|
// Copyright 2013 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.
|
|
|
|
|
2022-09-21 21:52:00 -06:00
|
|
|
// Issue 4847: initialization cycle is not detected.
|
2013-08-29 02:16:09 -06:00
|
|
|
|
|
|
|
package p
|
|
|
|
|
|
|
|
type (
|
|
|
|
E int
|
|
|
|
S int
|
|
|
|
)
|
|
|
|
|
|
|
|
type matcher func(s *S) E
|
|
|
|
|
|
|
|
func matchList(s *S) E { return matcher(matchAnyFn)(s) }
|
|
|
|
|
|
|
|
var foo = matcher(matchList)
|
|
|
|
|
2022-09-21 21:52:00 -06:00
|
|
|
var matchAny = matcher(matchList) // ERROR "initialization cycle|depends upon itself"
|
2013-08-29 02:16:09 -06:00
|
|
|
|
|
|
|
func matchAnyFn(s *S) (err E) { return matchAny(s) }
|