Source file test/fixedbugs/issue22904.go

     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  
    10  package p
    11  
    12  type a struct{ b } // ERROR "invalid recursive type"
    13  type b struct{ a } // GCCGO_ERROR "invalid recursive type"
    14  
    15  var x interface{}
    16  
    17  func f() {
    18  	x = a{}
    19  }
    20  

View as plain text