mirror of
https://github.com/golang/go
synced 2024-11-19 13:34:45 -07:00
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 <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
2ce295e954
commit
6decd3d984
@ -4399,6 +4399,17 @@ func TestStructOf(t *testing.T) {
|
|||||||
})
|
})
|
||||||
// check that type already in binary is found
|
// check that type already in binary is found
|
||||||
checkSameType(t, StructOf(fields[2:3]), struct{ Y uint64 }{})
|
checkSameType(t, StructOf(fields[2:3]), struct{ Y uint64 }{})
|
||||||
|
|
||||||
|
// gccgo used to fail this test.
|
||||||
|
type structFieldType interface{}
|
||||||
|
checkSameType(t,
|
||||||
|
StructOf([]StructField{
|
||||||
|
StructField{
|
||||||
|
Name: "F",
|
||||||
|
Type: TypeOf((*structFieldType)(nil)).Elem(),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
struct{ F structFieldType }{})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestStructOfExportRules(t *testing.T) {
|
func TestStructOfExportRules(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user