blob: 46cb7c048aedcfc81f95f68f29cced7eb70449a9 [file] [log] [blame]
Dan Willemsene1b3b182018-02-27 19:36:27 -08001// 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 }
13type b struct{ a } // ERROR "invalid recursive type"
14
15var x interface{}
16
17func f() {
18 x = a{}
19}