Skip to content

Commit

Permalink
reflect: implement StructOf
Browse files Browse the repository at this point in the history
This change exposes a facility to create new struct types from a slice of
reflect.StructFields.

- reflect: implement StructOf
- reflect: tests for StructOf

Fixes golang#5748.

Change-Id: I3b8fd4fadd6ce3b1b922e284f0ae72a3a8e3ce44
  • Loading branch information
sbinet committed Mar 29, 2016
1 parent 12fb62a commit 9eb1741
Show file tree
Hide file tree
Showing 3 changed files with 839 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/gc/reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ ok:
// we want be able to find.
if t.Sym == nil {
switch t.Etype {
case TPTR32, TPTR64, TARRAY, TCHAN, TFUNC, TMAP:
case TPTR32, TPTR64, TARRAY, TCHAN, TFUNC, TMAP, TSTRUCT:
slink := typelinksym(t)
dsymptr(slink, 0, s, 0)
ggloblsym(slink, int32(Widthptr), int16(dupok|obj.RODATA))
Expand Down
Loading

0 comments on commit 9eb1741

Please sign in to comment.