]> Cypherpunks repositories - gostls13.git/commitdiff
reflect: add StructOf test case that gccgo used to fail
authorIan Lance Taylor <iant@golang.org>
Tue, 5 Jun 2018 23:57:49 +0000 (16:57 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 6 Jun 2018 14:08:42 +0000 (14:08 +0000)
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>
src/reflect/all_test.go

index 077220ac7fa4bb250d4a6e87db8443b9f846daf6..63d068cd78c76f6e9c1f50f5e169f902efdabf1a 100644 (file)
@@ -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) {