aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2018-06-05 16:57:49 -0700
committerIan Lance Taylor <iant@golang.org>2018-06-06 14:08:42 +0000
commit6decd3d984dd0bb213837b64ab6870568b33f197 (patch)
tree898282720dbb1f6718d58b0d7e041dadca9d23f0
parent2ce295e9542c104110a050bf809dd0a37e191eb7 (diff)
downloadgo-6decd3d984dd0bb213837b64ab6870568b33f197.tar.xz
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>
-rw-r--r--src/reflect/all_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/reflect/all_test.go b/src/reflect/all_test.go
index 077220ac7f..63d068cd78 100644
--- a/src/reflect/all_test.go
+++ b/src/reflect/all_test.go
@@ -4399,6 +4399,17 @@ func TestStructOf(t *testing.T) {
})
// check that type already in binary is found
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) {