Skip to content

Commit 6decd3d

Browse files
reflect: add StructOf test case that gccgo used to fail
Updates #25284 Change-Id: I8ca382dd85b428ad6899d9277cf7f3ce34e35e9a Reviewed-on: https://go-review.googlesource.com/116416 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
1 parent 2ce295e commit 6decd3d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/reflect/all_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4399,6 +4399,17 @@ func TestStructOf(t *testing.T) {
43994399
})
44004400
// check that type already in binary is found
44014401
checkSameType(t, StructOf(fields[2:3]), struct{ Y uint64 }{})
4402+
4403+
// gccgo used to fail this test.
4404+
type structFieldType interface{}
4405+
checkSameType(t,
4406+
StructOf([]StructField{
4407+
StructField{
4408+
Name: "F",
4409+
Type: TypeOf((*structFieldType)(nil)).Elem(),
4410+
},
4411+
}),
4412+
struct{ F structFieldType }{})
44024413
}
44034414

44044415
func TestStructOfExportRules(t *testing.T) {

0 commit comments

Comments
 (0)