Source file test/fixedbugs/issue46653.dir/bad/bad.go

     1  // Copyright 2021 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package a
     6  
     7  func Bad() {
     8  	m := make(map[int64]A)
     9  	a := m[0]
    10  	if len(a.B.C1.D2.E2.F1) != 0 ||
    11  		len(a.B.C1.D2.E2.F2) != 0 ||
    12  		len(a.B.C1.D2.E2.F3) != 0 ||
    13  		len(a.B.C1.D2.E2.F4) != 0 ||
    14  		len(a.B.C1.D2.E2.F5) != 0 ||
    15  		len(a.B.C1.D2.E2.F6) != 0 ||
    16  		len(a.B.C1.D2.E2.F7) != 0 ||
    17  		len(a.B.C1.D2.E2.F8) != 0 ||
    18  		len(a.B.C1.D2.E2.F9) != 0 ||
    19  		len(a.B.C1.D2.E2.F10) != 0 ||
    20  		len(a.B.C1.D2.E2.F11) != 0 ||
    21  		len(a.B.C1.D2.E2.F16) != 0 {
    22  		panic("bad")
    23  	}
    24  }
    25  
    26  type A struct {
    27  	B
    28  }
    29  
    30  type B struct {
    31  	C1 C
    32  	C2 C
    33  }
    34  
    35  type C struct {
    36  	D1 D
    37  	D2 D
    38  }
    39  
    40  type D struct {
    41  	E1 E
    42  	E2 E
    43  	E3 E
    44  	E4 E
    45  }
    46  
    47  type E struct {
    48  	F1  string
    49  	F2  string
    50  	F3  string
    51  	F4  string
    52  	F5  string
    53  	F6  string
    54  	F7  string
    55  	F8  string
    56  	F9  string
    57  	F10 string
    58  	F11 string
    59  	F12 string
    60  	F13 string
    61  	F14 string
    62  	F15 string
    63  	F16 string
    64  }
    65  

View as plain text