2012-10-07 09:35:21 -06:00
|
|
|
// errorcheck
|
|
|
|
|
2016-04-10 15:32:26 -06:00
|
|
|
// Copyright 2012 The Go Authors. All rights reserved.
|
2012-10-07 09:35:21 -06:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// Issue 3757: unhelpful typechecking loop message
|
|
|
|
// for constants that refer to themselves.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
2020-12-09 21:14:07 -07:00
|
|
|
const a = a // ERROR "refers to itself|definition loop|initialization loop"
|
2012-10-07 09:35:21 -06:00
|
|
|
|
|
|
|
const (
|
|
|
|
X = A
|
2020-12-09 21:14:07 -07:00
|
|
|
A = B // ERROR "refers to itself|definition loop|initialization loop"
|
2012-10-07 09:35:21 -06:00
|
|
|
B = D
|
|
|
|
C, D = 1, A
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
}
|