modernc.org/gc@v1.0.1-0.20240304020402-f0dba7c97c2b/testdata/errchk/test/fixedbugs/issue8028.go (about)

     1  // compile
     2  
     3  // Copyright 2014 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 8028. Used to fail in -race mode with "non-orig name" error.
     8  
     9  package p
    10  
    11  var (
    12  	t2 = T{F, "s1"}
    13  	t1 = T{F, "s2"}
    14  
    15  	tt = [...]T{t1, t2}
    16  )
    17  
    18  type I interface{}
    19  
    20  type T struct {
    21  	F func() I
    22  	S string
    23  }
    24  
    25  type E struct{}
    26  
    27  func F() I { return new(E) }