1// errorcheck 2 3// Copyright 2017 The Go Authors. All rights reserved. 4// Use of this source code is governed by a BSD-style 5// license that can be found in the LICENSE file. 6 7// Issue 22904: Make sure the compiler emits a proper error message about 8// invalid recursive types rather than crashing. 9 10package p 11 12type a struct{ b } // ERROR "invalid recursive type" 13type b struct{ a } // GCCGO_ERROR "invalid recursive type" 14 15var x interface{} 16 17func f() { 18 x = a{} 19} 20