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

     1  // compile
     2  
     3  // Copyright 2016 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 13337: The Go compiler limited how deeply embedded types
     8  // were searched for promoted fields and methods.
     9  
    10  package s
    11  
    12  type S0 struct{ f int }
    13  func (S0) m() {}
    14  
    15  type S1 struct{ S0 }
    16  type S2 struct{ S1 }
    17  type S3 struct{ S2 }
    18  type S4 struct{ S3 }
    19  type S5 struct{ S4 }
    20  type S6 struct{ S5 }
    21  type S7 struct{ S6 }
    22  type S8 struct{ S7 }
    23  type S9 struct{ S8 }
    24  type S10 struct{ S9 }
    25  type S11 struct{ S10 }
    26  type S12 struct{ S11 }
    27  type S13 struct{ S12 }
    28  
    29  var _ = S13{}.f
    30  var _ = S13.m