Source file src/internal/types/testdata/fixedbugs/issue68184.go
1 // Copyright 2024 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 p 6 7 type VeryLongStruct struct { 8 A1 int 9 A2 int 10 A3 int 11 A4 int 12 A5 int 13 A6 int 14 A7 int 15 A8 int 16 A9 int 17 A10 int 18 A11 int 19 A12 int 20 A13 int 21 A14 int 22 A15 int 23 A16 int 24 A17 int 25 A18 int 26 A19 int 27 A20 int 28 } 29 30 func _() { 31 // The error messages in both these cases should print the 32 // struct name rather than the struct's underlying type. 33 34 var x VeryLongStruct 35 x.B2 /* ERROR "x.B2 undefined (type VeryLongStruct has no field or method B2)" */ = false 36 37 _ = []VeryLongStruct{{B2 /* ERROR "unknown field B2 in struct literal of type VeryLongStruct" */ : false}} 38 } 39